logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ihabu...@apache.org
Subject svn commit: r1310279 - /logging/log4php/trunk/src/main/php/appenders/LoggerAppenderFirephp.php
Date Fri, 06 Apr 2012 11:21:35 GMT
Author: ihabunek
Date: Fri Apr  6 11:21:35 2012
New Revision: 1310279

URL: http://svn.apache.org/viewvc?rev=1310279&view=rev
Log:
Added handling of objects and arrays to FirePHP appender.

Modified:
    logging/log4php/trunk/src/main/php/appenders/LoggerAppenderFirephp.php

Modified: logging/log4php/trunk/src/main/php/appenders/LoggerAppenderFirephp.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/main/php/appenders/LoggerAppenderFirephp.php?rev=1310279&r1=1310278&r2=1310279&view=diff
==============================================================================
--- logging/log4php/trunk/src/main/php/appenders/LoggerAppenderFirephp.php (original)
+++ logging/log4php/trunk/src/main/php/appenders/LoggerAppenderFirephp.php Fri Apr  6 11:21:35
2012
@@ -71,9 +71,14 @@ class LoggerAppenderFirephp extends Logg
 			$this->warn('FirePHP is not installed correctly. Closing appender.');
 		}
 	}
-
+	
 	public function append(LoggerLoggingEvent $event) {
-		$msg = $this->getLayout()->format($event);
+		$msg = $event->getMessage();
+		
+		// Skip formatting for objects and arrays which are handled by FirePHP.
+		if (!is_array($msg) && !is_object($msg)) {
+			$msg = $this->getLayout()->format($event);
+		}
 		
 		switch ($event->getLevel()->toInt()) {
 			case LoggerLevel::TRACE:



Mime
View raw message