From: <msc...@ao...> - 2003-07-25 07:03:12
|
In a message dated 7/24/2003 9:00:45 AM Eastern Standard Time, jo...@vi... writes: > according to the documentation the command > Log::Log4perl::Logger::create_custom_level("NOTIFY", "WARN"); > should add the custom level NOTIFY right ***AFTER*** the level WARN. > But within log4Perl Version 0.35 the implementation is wrong: > NOTIFY is added ***BEFORE*** the level WARN. Hey Johannes, hmmmm, the terms "after" and "before" might be a bit scewed in the Log4perl world, let's see, let me try to analyze the problem, according to the documentation, create_custom_level("NOTIFY", "WARN") would add a level "NOTIFY" between "INFO" and "WARN". I've a attached a code snippet illustrating the issue -- can you explain what's wrong with it? -- Mike ############################ # Mike Schilli # # log...@pe... # # http://perlmeister.com # # log4perl.sourceforge.net # ############################ use Log::Log4perl qw(get_logger); use Log::Log4perl::Level; Log::Log4perl::Logger::create_custom_level("NOTIFY", "WARN"); Log::Log4perl->init(\ <<EOT log4perl.category = NOTIFY, Screen log4perl.appender.Screen = Log::Log4perl::Appender::Screen log4perl.appender.Screen.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.Screen.layout.ConversionPattern = %d %F{1} %L> %m %n EOT ); my $logger = get_logger(); $logger->debug("debug"); $logger->info("info"); $logger->notify("notify"); $logger->warn("warn"); __END__ 2003/07/25 00:00:32 t 24> notify 2003/07/25 00:00:32 t 25> warn |