From: Johannes K. <jo...@vi...> - 2003-07-24 12:59:27
|
Hi there, 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. Either the documentation has to be changed, or the following patch corrects the behaviour.... Greetings Johannes Patch for Log::Log4perl::Logger.pm ------SNIP HERE---------------------- *** c:\Programme\Perl\site\lib\Log\Log4perl\Logger.pm Thu Jul 24 14:42:52 2003 --- c:\Programme\Perl\site\lib\Log\Log4perl\Logger_ori.pm Sun Jun 8 19:37:08 2003 *************** *** 507,513 **** # figure out new int value by AFTER + (AFTER+ 1) / 2 ! my $next_prio = Log::Log4perl::Level::get_higher_level($PRIORITY{$after}, 1); my $cust_prio = int(($PRIORITY{$after} + $next_prio) / 2); # CORE::warn("Creating prio $cust_prio between $PRIORITY{$after} and $next_prio"); --- 507,513 ---- # figure out new int value by AFTER + (AFTER+ 1) / 2 ! my $next_prio = Log::Log4perl::Level::get_lower_level($PRIORITY{$after}, 1); my $cust_prio = int(($PRIORITY{$after} + $next_prio) / 2); # CORE::warn("Creating prio $cust_prio between $PRIORITY{$after} and $next_prio"); ------SNIP HERE---------------------- |