logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ihabu...@apache.org
Subject svn commit: r1187849 - /logging/log4php/trunk/src/main/php/LoggerAppender.php
Date Sun, 23 Oct 2011 07:56:22 GMT
Author: ihabunek
Date: Sun Oct 23 07:56:21 2011
New Revision: 1187849

URL: http://svn.apache.org/viewvc?rev=1187849&view=rev
Log:
Minor cleanup of LoggerAppender. Changed warn() method to include appedner class in warning.

Modified:
    logging/log4php/trunk/src/main/php/LoggerAppender.php

Modified: logging/log4php/trunk/src/main/php/LoggerAppender.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/main/php/LoggerAppender.php?rev=1187849&r1=1187848&r2=1187849&view=diff
==============================================================================
--- logging/log4php/trunk/src/main/php/LoggerAppender.php (original)
+++ logging/log4php/trunk/src/main/php/LoggerAppender.php Sun Oct 23 07:56:21 2011
@@ -37,14 +37,14 @@ abstract class LoggerAppender {
 	 * The first filter in the filter chain.
 	 * @var LoggerFilter
 	 */
-	protected $filter = null;
+	protected $filter;
 			
 	/**
 	 * The appender's layout. Can be null if the appender does not use 
 	 * a layout.
 	 * @var LoggerLayout
 	 */
-	protected $layout = null; 
+	protected $layout; 
 	
 	/**
 	 * Appender name. Used by other components to identify this appender.
@@ -57,7 +57,7 @@ abstract class LoggerAppender {
 	 * will not be logged.
 	 * @var LoggerLevel
 	 */
-	protected $threshold = null;
+	protected $threshold;
 	
 	/**
 	 * Set to true if the appender requires a layout.
@@ -101,7 +101,6 @@ abstract class LoggerAppender {
 	 */
 	public function clearFilters() {
 		unset($this->filter);
-		$this->filter = null;
 	}
 
 	/**
@@ -273,7 +272,8 @@ abstract class LoggerAppender {
 	
 	/** Triggers a warning for this logger with the given message. */
 	protected function warn($message) {
-		trigger_error("log4php: appender [{$this->name}]: $message", E_USER_WARNING);
+		$id = get_class($this) . (empty($this->name) ? '' : ":{$this->name}");
+		trigger_error("log4php: [$id]: $message", E_USER_WARNING);
 	}
 	
 }



Mime
View raw message