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/20 08:02:45 UTC
svn commit: r776570 - in /incubator/log4php/trunk/src:
main/php/LoggerHierarchy.php test/php/LoggerHierarchyTest.php
test/php/LoggerLevelTest.php test/php/LoggerRootTest.php
Author: grobmeier
Date: Wed May 20 06:02:45 2009
New Revision: 776570
URL: http://svn.apache.org/viewvc?rev=776570&view=rev
Log:
encapsulated property access (used already defined method instead of properties)
Modified:
incubator/log4php/trunk/src/main/php/LoggerHierarchy.php
incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php
incubator/log4php/trunk/src/test/php/LoggerLevelTest.php
incubator/log4php/trunk/src/test/php/LoggerRootTest.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=776570&r1=776569&r2=776570&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/LoggerHierarchy.php (original)
+++ incubator/log4php/trunk/src/main/php/LoggerHierarchy.php Wed May 20 06:02:45 2009
@@ -234,7 +234,7 @@
* @return boolean
*/
public function isDisabled($level) {
- return ($this->threshold->level > $level->level);
+ return ($this->threshold->toInt() > $level->toInt());
}
/**
Modified: incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php?rev=776570&r1=776569&r2=776570&view=diff
==============================================================================
--- incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php (original)
+++ incubator/log4php/trunk/src/test/php/LoggerHierarchyTest.php Wed May 20 06:02:45 2009
@@ -31,7 +31,7 @@
}
public function testIfLevelIsInitiallyLevelDebug() {
- self::assertEquals('DEBUG', $this->hierarchy->getRootLogger()->getLevel()->levelStr);
+ self::assertEquals('DEBUG', $this->hierarchy->getRootLogger()->getLevel()->toString());
}
public function testIfNameIsRoot() {
@@ -54,8 +54,8 @@
$logger = $this->hierarchy->getLogger('test');
self::assertEquals(count($this->hierarchy->getCurrentLoggers()), 1);
$this->hierarchy->resetConfiguration();
- self::assertEquals($this->hierarchy->getRootLogger()->getLevel()->levelStr, 'DEBUG');
- self::assertEquals($this->hierarchy->getThreshold()->levelStr, 'ALL');
+ self::assertEquals($this->hierarchy->getRootLogger()->getLevel()->toString(), 'DEBUG');
+ self::assertEquals($this->hierarchy->getThreshold()->toString(), 'ALL');
self::assertEquals(count($this->hierarchy->getCurrentLoggers()), 1);
foreach($this->hierarchy->getCurrentLoggers() as $l) {
self::assertEquals($l->getLevel(), null);
Modified: incubator/log4php/trunk/src/test/php/LoggerLevelTest.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/test/php/LoggerLevelTest.php?rev=776570&r1=776569&r2=776570&view=diff
==============================================================================
--- incubator/log4php/trunk/src/test/php/LoggerLevelTest.php (original)
+++ incubator/log4php/trunk/src/test/php/LoggerLevelTest.php Wed May 20 06:02:45 2009
@@ -29,9 +29,9 @@
protected function doTestLevel($o, $code, $str, $syslog) {
self::assertTrue( $o instanceof LoggerLevel );
- self::assertEquals( $o->level, $code);
- self::assertEquals( $o->levelStr, $str);
- self::assertEquals( $o->syslogEquivalent, $syslog);
+ self::assertEquals( $o->toInt(), $code);
+ self::assertEquals( $o->toString(), $str);
+ self::assertEquals( $o->getSyslogEquivalent(), $syslog);
}
public function testLevelOff() {
Modified: incubator/log4php/trunk/src/test/php/LoggerRootTest.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/test/php/LoggerRootTest.php?rev=776570&r1=776569&r2=776570&view=diff
==============================================================================
--- incubator/log4php/trunk/src/test/php/LoggerRootTest.php (original)
+++ incubator/log4php/trunk/src/test/php/LoggerRootTest.php Wed May 20 06:02:45 2009
@@ -31,7 +31,7 @@
}
public function testIfLevelIsInitiallyLevelAll() {
- self::assertEquals($this->loggerRoot->getLevel()->levelStr, 'ALL');
+ self::assertEquals($this->loggerRoot->getLevel()->toString(), 'ALL');
}
public function testIfNameIsRoot() {