[Jifty-commit] r1388 - in jifty/trunk: lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Jun 28 13:02:38 EDT 2006


Author: alexmv
Date: Wed Jun 28 13:02:27 2006
New Revision: 1388

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Logger.pm

Log:
 r14514 at zoq-fot-pik:  chmrr | 2006-06-28 13:02:14 -0400
  * Remove trailing newlines from WARN handler


Modified: jifty/trunk/lib/Jifty/Logger.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Logger.pm	(original)
+++ jifty/trunk/lib/Jifty/Logger.pm	Wed Jun 28 13:02:27 2006
@@ -72,7 +72,12 @@
 
         # If the logger has been taken apart by global destruction,
         # don't try to use it to log warnings
-        $logger->warn(@_) if Log::Log4perl->initialized;
+        if (Log::Log4perl->initialized) {
+            # @_ often has read-only scalars, so we need to break
+            # the aliasing so we can remove trailing newlines
+            my @lines = map {"$_"} @_;
+            $logger->warn(map {chomp; $_} @lines);
+        }
     };
 
     return $self;


More information about the Jifty-commit mailing list