You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by gr...@apache.org on 2009/05/22 19:29:28 UTC

svn commit: r777626 - /incubator/log4php/trunk/src/main/php/LoggerHierarchy.php

Author: grobmeier
Date: Fri May 22 17:29:28 2009
New Revision: 777626

URL: http://svn.apache.org/viewvc?rev=777626&view=rev
Log:
cleaned up

Modified:
    incubator/log4php/trunk/src/main/php/LoggerHierarchy.php

Modified: incubator/log4php/trunk/src/main/php/LoggerHierarchy.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/LoggerHierarchy.php?rev=777626&r1=777625&r2=777626&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/LoggerHierarchy.php (original)
+++ incubator/log4php/trunk/src/main/php/LoggerHierarchy.php Fri May 22 17:29:28 2009
@@ -39,49 +39,29 @@
  * @version $Revision$
  * @package log4php
  */
+ /*
+  * TODO:
+  * - addHierarchyEventListener($listener) not supported
+  * - emitNoAppenderWarning($cat) not supported
+  * - fireAddAppenderEvent not supported
+  */
 class LoggerHierarchy {
-
-	/**
-	 * @var object currently unused
-	 */
+	/** Default Factory  */
 	protected $defaultFactory;
 	
-	/**
-	 * @var boolean activate internal logging
-	 * @see LoggerLog
-	 */
-	public $debug = false;
-
-	/**
-	 * @var array hierarchy tree. saves here all loggers
-	 */
+	/** array hierarchy tree. saves here all loggers */
 	protected $ht = array();
 	
-	/**
-	 * @var LoggerRoot
-	 */
+	/** The root Logger */
 	protected $root = null;
 	
-	/**
-	 * @var LoggerRendererMap
-	 */
+	/** LoggerRendererMap */
 	protected $rendererMap;
 
-	/**
-	 * @var LoggerLevel main level threshold
-	 */
+	/** LoggerLevel main level threshold */
 	protected $threshold;
 	
-	/**
-	 * @var boolean currently unused
-	 */
-	protected $emittedNoAppenderWarning		  = false;
-
-	/**
-	 * @var boolean currently unused
-	 */
-	protected $emittedNoResourceBundleWarning = false;
-	
+	/* TODO: In log4j is this class not a singleton. Why is it in log4php? */
 	public static function singleton() {
 		static $instance;
 		if(!isset($instance)) {
@@ -94,7 +74,7 @@
 	 * Create a new logger hierarchy.
 	 * @param object $root the root logger
 	 */
-	protected function __construct($root) {
+	protected function __construct(LoggerRoot $root) {
 		$this->root = $root;
 		// Enable all level levels by default.
 		$this->setThreshold(LoggerLevel::getLevelAll());
@@ -104,14 +84,6 @@
 	}
 	 
 	/**
-	 * Add a HierarchyEventListener event to the repository. 
-	 * Not Yet Impl.
-	 */
-	public function addHierarchyEventListener($listener) {
-		return;
-	}
-	 
-	/**
 	 * Add an object renderer for a specific class.
 	 * @param string $classToRender
 	 * @param LoggerObjectRenderer $or
@@ -127,10 +99,6 @@
 		$this->ht = array();
 	}
 	  
-	public function emitNoAppenderWarning($cat) {
-		return;
-	}
-	
 	/**
 	 * Check if the named logger exists in the hierarchy.
 	 * @param string $name
@@ -141,15 +109,6 @@
 	}
 
 	/**
-	 * Not Implemented.
-	 * @param Logger $logger
-	 * @param LoggerAppender $appender
-	 */
-	public function fireAddAppenderEvent($logger, $appender) {
-		return;
-	}
-		
-	/**
 	 * Returns all the currently defined categories in this hierarchy as an array.
 	 * @return array
 	 */	 
@@ -233,7 +192,7 @@
 	 * for level object passed as parameter and false otherwise.
 	 * @return boolean
 	 */
-	public function isDisabled($level) {
+	public function isDisabled(LoggerLevel $level) {
 		return ($this->threshold->toInt() > $level->toInt());
 	}
 	
@@ -284,7 +243,7 @@
 	 *
 	 * @param LoggerLevel $l
 	 */
-	public function setThreshold($l) {
+	public function setThreshold(LoggerLevel $l) {
 		if($l !== null) {
 			$this->threshold = $l;
 		}
@@ -314,5 +273,4 @@
 			}
 		}
 	}
- 
 }