Skip to content

Commit

Permalink
(GH-1448) API: Set logging levels based on switches
Browse files Browse the repository at this point in the history
Based on the switches passed, the logging levels should be set
appropriately for API use. This is for Debug/Verbose/Trace logging.
  • Loading branch information
ferventcoder committed Nov 6, 2017
1 parent 2ccf02f commit 3a33d25
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/chocolatey/GetChocolatey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,12 @@ private T ensure_original_configuration<T>(IList<string> args, Func<ChocolateyCo
{
returnValue = function.Invoke(configuration);
}

var verboseAppenderName = "{0}LoggingColoredConsoleAppender".format_with(ChocolateyLoggers.Verbose.to_string());
var traceAppenderName = "{0}LoggingColoredConsoleAppender".format_with(ChocolateyLoggers.Trace.to_string());
Log4NetAppenderConfiguration.set_logging_level_debug_when_debug(configuration.Debug, verboseAppenderName, traceAppenderName);
Log4NetAppenderConfiguration.set_verbose_logger_when_verbose(configuration.Verbose, configuration.Debug, verboseAppenderName);
Log4NetAppenderConfiguration.set_trace_logger_when_trace(configuration.Trace, traceAppenderName);
}
finally
{
Expand Down

0 comments on commit 3a33d25

Please sign in to comment.