Skip to content

Commit

Permalink
fix for issue 40 (#40) - Make /debug switch work.
Browse files Browse the repository at this point in the history
  • Loading branch information
ferventcoder committed Dec 20, 2011
1 parent 31c6744 commit ea8ba5e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions product/roundhouse.console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using log4net;
using log4net.Core;
using log4net.Repository;
using log4net.Repository.Hierarchy;
using migrators;
using resolvers;
using runners;
Expand Down Expand Up @@ -62,14 +63,15 @@ public static ConfigurationPropertyHolder set_up_configuration_and_build_the_con
{
ConfigurationPropertyHolder configuration = new DefaultConfiguration();
parse_arguments_and_set_up_configuration(configuration, args);

ApplicationConfiguraton.set_defaults_if_properties_are_not_set(configuration);
ApplicationConfiguraton.build_the_container(configuration);

if (configuration.Debug)
{
change_log_to_debug_level();
}

ApplicationConfiguraton.set_defaults_if_properties_are_not_set(configuration);
ApplicationConfiguraton.build_the_container(configuration);


return configuration;
}

Expand Down Expand Up @@ -359,6 +361,14 @@ public static void change_log_to_debug_level()
{
ILoggerRepository log_repository = LogManager.GetRepository(Assembly.GetCallingAssembly());
log_repository.Threshold = Level.Debug;
foreach (ILogger log in log_repository.GetCurrentLoggers())
{
var logger = log as log4net.Repository.Hierarchy.Logger;
if (logger != null)
{
logger.Level = log4net.Core.Level.Debug;
}
}
}

public static void run_migrator(ConfigurationPropertyHolder configuration)
Expand Down

0 comments on commit ea8ba5e

Please sign in to comment.