Skip to content

Commit

Permalink
Fixes SnaffCon#138 by limiting all output to just data when -v data i…
Browse files Browse the repository at this point in the history
…s selected
  • Loading branch information
l0ss committed Apr 15, 2024
1 parent 8f07483 commit 3cd1011
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Snaffler/SnaffleRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,28 @@ public void Run(string[] args)
}
}
};
nlogConfig.AddRule(LogLevel, LogLevel.Fatal, logconsole);
if (LogLevel == LogLevel.Warn)
{
nlogConfig.AddRule(LogLevel.Warn, LogLevel.Warn, logconsole);
}
else
{
nlogConfig.AddRule(LogLevel, LogLevel.Fatal, logconsole);
}
logconsole.Layout = "${message}";
}

if (Options.LogToFile)
{
logfile = new FileTarget("logfile") { FileName = Options.LogFilePath };
nlogConfig.AddRule(LogLevel, LogLevel.Fatal, logfile);
if (LogLevel == LogLevel.Warn)
{
nlogConfig.AddRule(LogLevel.Warn, LogLevel.Warn, logfile);
}
else
{
nlogConfig.AddRule(LogLevel, LogLevel.Fatal, logfile);
}
if (Options.LogType == LogType.Plain)
{
logfile.Layout = "${message}";
Expand Down

0 comments on commit 3cd1011

Please sign in to comment.