[Bps-public-commit] r18905 - Shipwright/trunk/lib/Shipwright

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sun Mar 22 04:20:28 EDT 2009


Author: sunnavy
Date: Sun Mar 22 04:20:27 2009
New Revision: 18905

Modified:
   Shipwright/trunk/lib/Shipwright/Logger.pm

Log:
removed the screen logger configuration, file named - can do this

Modified: Shipwright/trunk/lib/Shipwright/Logger.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Logger.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Logger.pm	Sun Mar 22 04:20:27 2009
@@ -56,31 +56,17 @@
     }
 
     $log_level = uc $log_level || 'FATAL';
-    my %default;
-
-    if ($log_file) {
-        %default = (
-            'log4perl.rootLogger'             => "$log_level,File",
-            'log4perl.appender.File.filename' => $log_file,
-            'log4perl.appender.File'        => 'Log::Log4perl::Appender::File',
-            'log4perl.appender.File.stderr' => 1,
-            'log4perl.appender.File.layout' =>
-              'Log::Log4perl::Layout::PatternLayout',
-            'log4perl.appender.File.layout.ConversionPattern' =>
-              '%d %p> %F{1}:%L %M - %m%n',
-        );
-    }
-    else {
-        %default = (
-            'log4perl.rootLogger'      => "$log_level,Screen",
-            'log4perl.appender.Screen' => 'Log::Log4perl::Appender::Screen',
-            'log4perl.appender.Screen.stderr' => 1,
-            'log4perl.appender.Screen.layout' =>
-              'Log::Log4perl::Layout::PatternLayout',
-            'log4perl.appender.Screen.layout.ConversionPattern' =>
-              '%d %p> %F{1}:%L %M - %m%n',
-        );
-    }
+    $log_file ||= '-';
+    my %default = (
+        'log4perl.rootLogger'             => "$log_level,File",
+        'log4perl.appender.File.filename' => $log_file,
+        'log4perl.appender.File'          => 'Log::Log4perl::Appender::File',
+        'log4perl.appender.File.stderr'   => 1,
+        'log4perl.appender.File.layout' =>
+          'Log::Log4perl::Layout::PatternLayout',
+        'log4perl.appender.File.layout.ConversionPattern' =>
+        $log_file eq '-' ? '%m%n' : '%d %p> %F{1}:%L %M - %m%n',
+    );
 
     Log::Log4perl->init( \%default );
 }



More information about the Bps-public-commit mailing list