Skip to content

Commit

Permalink
Disable verbose logging
Browse files Browse the repository at this point in the history
  • Loading branch information
gyk4j committed Feb 19, 2024
1 parent d5a6f8e commit 1f1f063
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Wreck/IO/Task/AnalyzeTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ private IDictionary<CorrectionEnum, DateTime> Analyze(FileSystemInfo path)

readerFactory.DirectoryReader.Add(parent, suggestions);

LOG.InfoFormat("{0} C: {1}, M: {2}, A: {3} {4}",
LOG.DebugFormat("{0} C: {1}, M: {2}, A: {3} {4}",
!FSUtils.IsDirectory(path) && !FSUtils.IsReparsePoint(path)? "<F>": "[D]",
suggestions[CorrectionEnum.CREATION],
suggestions[CorrectionEnum.MODIFIED],
Expand Down
24 changes: 19 additions & 5 deletions Wreck/IO/Writer/BasicFileAttributesWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,34 @@ public override void Write(
file.LastAccessTime,
values[CorrectionEnum.ACCESSED]);

bool changed = false;

if(creation.HasValue)
{
file.CreationTime = creation.Value;
changed = true;
}

if(modified.HasValue)
{
file.LastWriteTime = modified.Value;
changed = true;
}

if(accessed.HasValue)
{
file.LastAccessTime = accessed.Value;
changed = true;
}

LOG.InfoFormat("Updated {0}: {1}, {2}, {3}",
file.FullName,
(creation.HasValue)? creation.Value.ToString() : "-",
(modified.HasValue)? modified.Value.ToString() : "-",
(accessed.HasValue)? accessed.Value.ToString() : "-");
if(changed)
{
LOG.InfoFormat("Updated {0}: {1}, {2}, {3}",
file.FullName,
(creation.HasValue)? creation.Value.ToString() : "-",
(modified.HasValue)? modified.Value.ToString() : "-",
(accessed.HasValue)? accessed.Value.ToString() : "-");
}
}
}
}
6 changes: 3 additions & 3 deletions WreckCli/Controller/CliController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,18 @@ public void PropertyChange(PropertyChangeEvent evt)
else if (R.Strings.PropertyProgress.Equals(evt.PropertyName))
{
int progress = (int)evt.NewValue;
LOG.InfoFormat("{0}%", progress);
LOG.DebugFormat("{0}%", progress);
}
else if (R.Strings.PropertyVisits.Equals(evt.PropertyName))
{
FileVisit visit = (FileVisit) evt.NewValue;

LOG.InfoFormat("{0} - {1}%", visit.File.FullName, visit.Progress);
LOG.DebugFormat("{0} - {1}%", visit.File.FullName, visit.Progress);
}
else if(R.Strings.PropertyBean.Equals(evt.PropertyName))
{
FileBean update = (FileBean) evt.NewValue;
LOG.InfoFormat("{0}, {1}, {2}, {3}, {4}",
LOG.DebugFormat("{0}, {1}, {2}, {3}, {4}",
update.Creation.ToString(),
update.Modified.ToString(),
update.Metadata.ToString(),
Expand Down
4 changes: 2 additions & 2 deletions WreckCli/log4net.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@

<!-- Set root logger level to DEBUG and its only appender to A1 -->
<root>
<level value="DEBUG" />
<level value="INFO" />
<appender-ref ref="A1" />
<appender-ref ref="OutputDebugAppender" />
<!-- appender-ref ref="RollingFile" / -->
</root>

<!-- Print only messages of level WARN or above in the package Wreck -->
<logger name="Wreck">
<level value="DEBUG" />
<level value="INFO" />
</logger>
</log4net>

0 comments on commit 1f1f063

Please sign in to comment.