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 ku...@apache.org on 2009/04/29 09:19:20 UTC
svn commit: r769689 - in /incubator/log4php/trunk/src: main/php/
main/php/appenders/ main/php/spi/ main/php/varia/ test/php/
Author: kurdalen
Date: Wed Apr 29 07:19:19 2009
New Revision: 769689
URL: http://svn.apache.org/viewvc?rev=769689&view=rev
Log:
fixes related to #LOG4PHP-32
Modified:
incubator/log4php/trunk/src/main/php/LoggerAppenderSkeleton.php
incubator/log4php/trunk/src/main/php/LoggerLevel.php
incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSocket.php
incubator/log4php/trunk/src/main/php/spi/LoggerFilter.php
incubator/log4php/trunk/src/main/php/varia/LoggerDenyAllFilter.php
incubator/log4php/trunk/src/main/php/varia/LoggerLevelMatchFilter.php
incubator/log4php/trunk/src/main/php/varia/LoggerLevelRangeFilter.php
incubator/log4php/trunk/src/main/php/varia/LoggerStringMatchFilter.php
incubator/log4php/trunk/src/test/php/LoggerLevelTest.php
Modified: incubator/log4php/trunk/src/main/php/LoggerAppenderSkeleton.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/LoggerAppenderSkeleton.php?rev=769689&r1=769688&r2=769689&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/LoggerAppenderSkeleton.php (original)
+++ incubator/log4php/trunk/src/main/php/LoggerAppenderSkeleton.php Wed Apr 29 07:19:19 2009
@@ -235,9 +235,9 @@
while($f !== null) {
switch ($f->decide($event)) {
- case LOG4PHP_LOGGER_FILTER_DENY: return;
- case LOG4PHP_LOGGER_FILTER_ACCEPT: return $this->append($event);
- case LOG4PHP_LOGGER_FILTER_NEUTRAL: $f = $f->getNext();
+ case LoggerFilter::DENY: return;
+ case LoggerFilter::ACCEPT: return $this->append($event);
+ case LoggerFilter::NEUTRAL: $f = $f->getNext();
}
}
$this->append($event);
Modified: incubator/log4php/trunk/src/main/php/LoggerLevel.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/LoggerLevel.php?rev=769689&r1=769688&r2=769689&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/LoggerLevel.php (original)
+++ incubator/log4php/trunk/src/main/php/LoggerLevel.php Wed Apr 29 07:19:19 2009
@@ -19,14 +19,6 @@
* @package log4php
*/
-define('LOG4PHP_LEVEL_OFF_INT', 2147483647);
-define('LOG4PHP_LEVEL_FATAL_INT', 50000);
-define('LOG4PHP_LEVEL_ERROR_INT', 40000);
-define('LOG4PHP_LEVEL_WARN_INT', 30000);
-define('LOG4PHP_LEVEL_INFO_INT', 20000);
-define('LOG4PHP_LEVEL_DEBUG_INT', 10000);
-define('LOG4PHP_LEVEL_ALL_INT', -2147483647);
-
/**
* Defines the minimum set of levels recognized by the system, that is
* <i>OFF</i>, <i>FATAL</i>, <i>ERROR</i>,
@@ -42,6 +34,14 @@
* @since 0.5
*/
class LoggerLevel {
+
+ const OFF = 2147483647;
+ const FATAL = 50000;
+ const ERROR = 40000;
+ const WARN = 30000;
+ const INFO = 20000;
+ const DEBUG = 10000;
+ const ALL = -2147483647;
/**
* @var integer
@@ -95,7 +95,7 @@
public static function getLevelOff()
{
static $level;
- if (!isset($level)) $level = new LoggerLevel(LOG4PHP_LEVEL_OFF_INT, 'OFF', 0);
+ if (!isset($level)) $level = new LoggerLevel(LoggerLevel::OFF, 'OFF', 0);
return $level;
}
@@ -107,7 +107,7 @@
public static function getLevelFatal()
{
static $level;
- if (!isset($level)) $level = new LoggerLevel(LOG4PHP_LEVEL_FATAL_INT, 'FATAL', 0);
+ if (!isset($level)) $level = new LoggerLevel(LoggerLevel::FATAL, 'FATAL', 0);
return $level;
}
@@ -119,7 +119,7 @@
public static function getLevelError()
{
static $level;
- if (!isset($level)) $level = new LoggerLevel(LOG4PHP_LEVEL_ERROR_INT, 'ERROR', 3);
+ if (!isset($level)) $level = new LoggerLevel(LoggerLevel::ERROR, 'ERROR', 3);
return $level;
}
@@ -131,7 +131,7 @@
public static function getLevelWarn()
{
static $level;
- if (!isset($level)) $level = new LoggerLevel(LOG4PHP_LEVEL_WARN_INT, 'WARN', 4);
+ if (!isset($level)) $level = new LoggerLevel(LoggerLevel::WARN, 'WARN', 4);
return $level;
}
@@ -143,7 +143,7 @@
public static function getLevelInfo()
{
static $level;
- if (!isset($level)) $level = new LoggerLevel(LOG4PHP_LEVEL_INFO_INT, 'INFO', 6);
+ if (!isset($level)) $level = new LoggerLevel(LoggerLevel::INFO, 'INFO', 6);
return $level;
}
@@ -155,7 +155,7 @@
public static function getLevelDebug()
{
static $level;
- if (!isset($level)) $level = new LoggerLevel(LOG4PHP_LEVEL_DEBUG_INT, 'DEBUG', 7);
+ if (!isset($level)) $level = new LoggerLevel(LoggerLevel::DEBUG, 'DEBUG', 7);
return $level;
}
@@ -167,7 +167,7 @@
public static function getLevelAll()
{
static $level;
- if (!isset($level)) $level = new LoggerLevel(LOG4PHP_LEVEL_ALL_INT, 'ALL', 7);
+ if (!isset($level)) $level = new LoggerLevel(LoggerLevel::ALL, 'ALL', 7);
return $level;
}
@@ -231,13 +231,13 @@
} else {
if (is_int($arg)) {
switch($arg) {
- case LOG4PHP_LEVEL_ALL_INT: return self::getLevelAll();
- case LOG4PHP_LEVEL_DEBUG_INT: return self::getLevelDebug();
- case LOG4PHP_LEVEL_INFO_INT: return self::getLevelInfo();
- case LOG4PHP_LEVEL_WARN_INT: return self::getLevelWarn();
- case LOG4PHP_LEVEL_ERROR_INT: return self::getLevelError();
- case LOG4PHP_LEVEL_FATAL_INT: return self::getLevelFatal();
- case LOG4PHP_LEVEL_OFF_INT: return self::getLevelOff();
+ case self::ALL: return self::getLevelAll();
+ case self::DEBUG: return self::getLevelDebug();
+ case self::INFO: return self::getLevelInfo();
+ case self::WARN: return self::getLevelWarn();
+ case self::ERROR: return self::getLevelError();
+ case self::FATAL: return self::getLevelFatal();
+ case self::OFF: return self::getLevelOff();
default: return $defaultLevel;
}
} else {
Modified: incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSocket.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSocket.php?rev=769689&r1=769688&r2=769689&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSocket.php (original)
+++ incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderSocket.php Wed Apr 29 07:19:19 2009
@@ -20,9 +20,6 @@
* @subpackage appenders
*/
-define('LOG4PHP_LOGGER_APPENDER_SOCKET_DEFAULT_PORT', 4446);
-define('LOG4PHP_LOGGER_APPENDER_SOCKET_DEFAULT_TIMEOUT', 30);
-
/**
* Serialize events and send them to a network socket.
*
@@ -52,7 +49,7 @@
/**
* @var integer the network port.
*/
- var $port = LOG4PHP_LOGGER_APPENDER_SOCKET_DEFAULT_PORT;
+ var $port = 4446;
/**
* @var boolean get event's location info.
@@ -62,7 +59,7 @@
/**
* @var integer connection timeout
*/
- var $timeout = LOG4PHP_LOGGER_APPENDER_SOCKET_DEFAULT_TIMEOUT;
+ var $timeout = 30;
/**
* @var boolean output events via {@link LoggerXmlLayout}
Modified: incubator/log4php/trunk/src/main/php/spi/LoggerFilter.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/spi/LoggerFilter.php?rev=769689&r1=769688&r2=769689&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/spi/LoggerFilter.php (original)
+++ incubator/log4php/trunk/src/main/php/spi/LoggerFilter.php Wed Apr 29 07:19:19 2009
@@ -21,24 +21,6 @@
*/
/**
- * The log event must be logged immediately without consulting with
- * the remaining filters, if any, in the chain.
- */
-define('LOG4PHP_LOGGER_FILTER_ACCEPT', 1);
-
-/**
- * This filter is neutral with respect to the log event. The
- * remaining filters, if any, should be consulted for a final decision.
- */
-define('LOG4PHP_LOGGER_FILTER_NEUTRAL', 0);
-
-/**
- * The log event must be dropped immediately without consulting
- * with the remaining filters, if any, in the chain.
- */
-define('LOG4PHP_LOGGER_FILTER_DENY', -1);
-
-/**
* Users should extend this class to implement customized logging
* event filtering. Note that {@link LoggerCategory} and {@link LoggerAppenderSkeleton},
* the parent class of all standard
@@ -52,19 +34,19 @@
* in the order of their addition to the chain.
*
* <p>The {@link decide()} method must return one
- * of the integer constants {@link LOG4PHP_LOG4PHP_LOGGER_FILTER_DENY},
- * {@link LOG4PHP_LOGGER_FILTER_NEUTRAL} or {@link LOG4PHP_LOGGER_FILTER_ACCEPT}.
+ * of the integer constants {@link LoggerFilter::DENY},
+ * {@link LoggerFilter::NEUTRAL} or {@link LoggerFilter::ACCEPT}.
*
- * <p>If the value {@link LOG4PHP_LOGGER_FILTER_DENY} is returned, then the log event is
+ * <p>If the value {@link LoggerFilter::DENY} is returned, then the log event is
* dropped immediately without consulting with the remaining
* filters.
*
- * <p>If the value {@link LOG4PHP_LOGGER_FILTER_NEUTRAL} is returned, then the next filter
+ * <p>If the value {@link LoggerFilter::NEUTRAL} is returned, then the next filter
* in the chain is consulted. If there are no more filters in the
* chain, then the log event is logged. Thus, in the presence of no
* filters, the default behaviour is to log all logging events.
*
- * <p>If the value {@link LOG4PHP_LOGGER_FILTER_ACCEPT} is returned, then the log
+ * <p>If the value {@link LoggerFilter::ACCEPT} is returned, then the log
* event is logged without consulting the remaining filters.
*
* <p>The philosophy of log4php filters is largely inspired from the
@@ -77,6 +59,24 @@
*/
class LoggerFilter {
+ /**
+ * The log event must be logged immediately without consulting with
+ * the remaining filters, if any, in the chain.
+ */
+ const ACCEPT = 1;
+
+ /**
+ * This filter is neutral with respect to the log event. The
+ * remaining filters, if any, should be consulted for a final decision.
+ */
+ const NEUTRAL = 0;
+
+ /**
+ * The log event must be dropped immediately without consulting
+ * with the remaining filters, if any, in the chain.
+ */
+ const DENY = -1;
+
/**
* @var LoggerFilter Points to the next {@link LoggerFilter} in the filter chain.
*/
@@ -93,18 +93,18 @@
/**
* Decide what to do.
- * <p>If the decision is {@link LOG4PHP_LOGGER_FILTER_DENY}, then the event will be
- * dropped. If the decision is {@link LOG4PHP_LOGGER_FILTER_NEUTRAL}, then the next
- * filter, if any, will be invoked. If the decision is {@link LOG4PHP_LOGGER_FILTER_ACCEPT} then
+ * <p>If the decision is {@link LoggerFilter::DENY}, then the event will be
+ * dropped. If the decision is {@link LoggerFilter::NEUTRAL}, then the next
+ * filter, if any, will be invoked. If the decision is {@link LoggerFilter::ACCEPT} then
* the event will be logged without consulting with other filters in
* the chain.
*
* @param LoggerLoggingEvent $event The {@link LoggerLoggingEvent} to decide upon.
- * @return integer {@link LOG4PHP_LOGGER_FILTER_NEUTRAL} or {@link LOG4PHP_LOGGER_FILTER_DENY}|{@link LOG4PHP_LOGGER_FILTER_ACCEPT}
+ * @return integer {@link LoggerFilter::NEUTRAL} or {@link LoggerFilter::DENY}|{@link LoggerFilter::ACCEPT}
*/
public function decide($event)
{
- return LOG4PHP_LOGGER_FILTER_NEUTRAL;
+ return self::NEUTRAL;
}
public function getNext() {
Modified: incubator/log4php/trunk/src/main/php/varia/LoggerDenyAllFilter.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/varia/LoggerDenyAllFilter.php?rev=769689&r1=769688&r2=769689&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/varia/LoggerDenyAllFilter.php (original)
+++ incubator/log4php/trunk/src/main/php/varia/LoggerDenyAllFilter.php Wed Apr 29 07:19:19 2009
@@ -37,14 +37,14 @@
class LoggerDenyAllFilter extends LoggerFilter {
/**
- * Always returns the integer constant {@link LOG4PHP_LOGGER_FILTER_DENY}
+ * Always returns the integer constant {@link LoggerFilter::DENY}
* regardless of the {@link LoggerLoggingEvent} parameter.
*
* @param LoggerLoggingEvent $event The {@link LoggerLoggingEvent} to filter.
- * @return LOG4PHP_LOGGER_FILTER_DENY Always returns {@link LOG4PHP_LOGGER_FILTER_DENY}
+ * @return LoggerFilter::DENY Always returns {@link LoggerFilter::DENY}
*/
function decide($event)
{
- return LOG4PHP_LOGGER_FILTER_DENY;
+ return LoggerFilter::DENY;
}
}
Modified: incubator/log4php/trunk/src/main/php/varia/LoggerLevelMatchFilter.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/varia/LoggerLevelMatchFilter.php?rev=769689&r1=769688&r2=769689&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/varia/LoggerLevelMatchFilter.php (original)
+++ incubator/log4php/trunk/src/main/php/varia/LoggerLevelMatchFilter.php Wed Apr 29 07:19:19 2009
@@ -27,10 +27,10 @@
* <b><var>AcceptOnMatch</var></b>. If there is an exact match between the value
* of the <b><var>LevelToMatch</var></b> option and the level of the
* {@link LoggerLoggingEvent}, then the {@link decide()} method returns
- * {@link LOG4PHP_LOGGER_FILTER_ACCEPT} in case the <b><var>AcceptOnMatch</var></b>
+ * {@link LoggerFilter::ACCEPT} in case the <b><var>AcceptOnMatch</var></b>
* option value is set to <i>true</i>, if it is <i>false</i> then
- * {@link LOG4PHP_LOGGER_FILTER_DENY} is returned. If there is no match,
- * {@link LOG4PHP_LOGGER_FILTER_NEUTRAL} is returned.</p>
+ * {@link LoggerFilter::DENY} is returned. If there is no match,
+ * {@link LoggerFilter::NEUTRAL} is returned.</p>
*
* @author Marco Vassura
* @version $Revision$
@@ -85,11 +85,11 @@
/**
* Return the decision of this filter.
*
- * Returns {@link LOG4PHP_LOGGER_FILTER_NEUTRAL} if the <b><var>LevelToMatch</var></b>
+ * Returns {@link LoggerFilter::NEUTRAL} if the <b><var>LevelToMatch</var></b>
* option is not set or if there is not match. Otherwise, if there is a
- * match, then the returned decision is {@link LOG4PHP_LOGGER_FILTER_ACCEPT} if the
+ * match, then the returned decision is {@link LoggerFilter::ACCEPT} if the
* <b><var>AcceptOnMatch</var></b> property is set to <i>true</i>. The
- * returned decision is {@link LOG4PHP_LOGGER_FILTER_DENY} if the
+ * returned decision is {@link LoggerFilter::DENY} if the
* <b><var>AcceptOnMatch</var></b> property is set to <i>false</i>.
*
* @param LoggerLoggingEvent $event
@@ -98,14 +98,14 @@
function decide($event)
{
if($this->levelToMatch === null)
- return LOG4PHP_LOGGER_FILTER_NEUTRAL;
+ return LoggerFilter::NEUTRAL;
if ($this->levelToMatch->equals($event->getLevel())) {
return $this->getAcceptOnMatch() ?
- LOG4PHP_LOGGER_FILTER_ACCEPT :
- LOG4PHP_LOGGER_FILTER_DENY;
+ LoggerFilter::ACCEPT :
+ LoggerFilter::DENY;
} else {
- return LOG4PHP_LOGGER_FILTER_NEUTRAL;
+ return LoggerFilter::NEUTRAL;
}
}
}
Modified: incubator/log4php/trunk/src/main/php/varia/LoggerLevelRangeFilter.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/varia/LoggerLevelRangeFilter.php?rev=769689&r1=769688&r2=769689&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/varia/LoggerLevelRangeFilter.php (original)
+++ incubator/log4php/trunk/src/main/php/varia/LoggerLevelRangeFilter.php Wed Apr 29 07:19:19 2009
@@ -28,13 +28,13 @@
* and <b><var>AcceptOnMatch</var></b>.</p>
*
* <p>If the level of the {@link LoggerLoggingEvent} is not between Min and Max
- * (inclusive), then {@link LOG4PHP_LOGGER_FILTER_DENY} is returned.</p>
+ * (inclusive), then {@link LoggerFilter::DENY} is returned.</p>
*
* <p>If the Logging event level is within the specified range, then if
* <b><var>AcceptOnMatch</var></b> is <i>true</i>,
- * {@link LOG4PHP_LOGGER_FILTER_ACCEPT} is returned, and if
+ * {@link LoggerFilter::ACCEPT} is returned, and if
* <b><var>AcceptOnMatch</var></b> is <i>false</i>,
- * {@link LOG4PHP_LOGGER_FILTER_NEUTRAL} is returned.</p>
+ * {@link LoggerFilter::NEUTRAL} is returned.</p>
*
* <p>If <b><var>LevelMin</var></b> is not defined, then there is no
* minimum acceptable level (i.e. a level is never rejected for
@@ -134,7 +134,7 @@
if($this->levelMin !== null) {
if ($level->isGreaterOrEqual($this->levelMin) == false) {
// level of event is less than minimum
- return LOG4PHP_LOGGER_FILTER_DENY;
+ return LoggerFilter::DENY;
}
}
@@ -144,17 +144,17 @@
// Alas, there is no Level.isGreater method. and using
// a combo of isGreaterOrEqual && !Equal seems worse than
// checking the int values of the level objects..
- return LOG4PHP_LOGGER_FILTER_DENY;
+ return LoggerFilter::DENY;
}
}
if ($this->getAcceptOnMatch()) {
// this filter set up to bypass later filters and always return
// accept if level in range
- return LOG4PHP_LOGGER_FILTER_ACCEPT;
+ return LoggerFilter::ACCEPT;
} else {
// event is ok for this filter; allow later filters to have a look..
- return LOG4PHP_LOGGER_FILTER_NEUTRAL;
+ return LoggerFilter::NEUTRAL;
}
}
}
Modified: incubator/log4php/trunk/src/main/php/varia/LoggerStringMatchFilter.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/varia/LoggerStringMatchFilter.php?rev=769689&r1=769688&r2=769689&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/varia/LoggerStringMatchFilter.php (original)
+++ incubator/log4php/trunk/src/main/php/varia/LoggerStringMatchFilter.php Wed Apr 29 07:19:19 2009
@@ -27,9 +27,9 @@
* {@link $acceptOnMatch}. If there is a match (using {@link PHP_MANUAL#strpos}
* between the value of the {@link $stringToMatch} option and the message
* of the {@link LoggerLoggingEvent},
- * then the {@link decide()} method returns {@link LOG4PHP_LOGGER_FILTER_ACCEPT} if
+ * then the {@link decide()} method returns {@link LoggerFilter::ACCEPT} if
* the <b>AcceptOnMatch</b> option value is true, if it is false then
- * {@link LOG4PHP_LOGGER_FILTER_DENY} is returned. If there is no match, {@link LOG4PHP_LOGGER_FILTER_NEUTRAL}
+ * {@link LoggerFilter::DENY} is returned. If there is no match, {@link LoggerFilter::NEUTRAL}
* is returned.</p>
*
* @author Marco Vassura
@@ -92,10 +92,10 @@
$msg = $event->getRenderedMessage();
if($msg === null or $this->stringToMatch === null)
- return LOG4PHP_LOGGER_FILTER_NEUTRAL;
+ return LoggerFilter::NEUTRAL;
if( strpos($msg, $this->stringToMatch) !== false ) {
- return ($this->acceptOnMatch) ? LOG4PHP_LOGGER_FILTER_ACCEPT : LOG4PHP_LOGGER_FILTER_DENY ;
+ return ($this->acceptOnMatch) ? LoggerFilter::ACCEPT : LoggerFilter::DENY ;
}
- return LOG4PHP_LOGGER_FILTER_NEUTRAL;
+ return LoggerFilter::NEUTRAL;
}
}
Modified: incubator/log4php/trunk/src/test/php/LoggerLevelTest.php
URL: http://svn.apache.org/viewvc/incubator/log4php/trunk/src/test/php/LoggerLevelTest.php?rev=769689&r1=769688&r2=769689&view=diff
==============================================================================
--- incubator/log4php/trunk/src/test/php/LoggerLevelTest.php (original)
+++ incubator/log4php/trunk/src/test/php/LoggerLevelTest.php Wed Apr 29 07:19:19 2009
@@ -36,44 +36,44 @@
}
public function testLevelOff() {
- $this->doTestLevel( LoggerLevel::getLevelOff(), LOG4PHP_LEVEL_OFF_INT, 'OFF', 0 );
- $this->doTestLevel( LoggerLevel::toLevel(LOG4PHP_LEVEL_OFF_INT), LOG4PHP_LEVEL_OFF_INT, 'OFF', 0 );
- $this->doTestLevel( LoggerLevel::toLevel('OFF'), LOG4PHP_LEVEL_OFF_INT, 'OFF', 0 );
+ $this->doTestLevel( LoggerLevel::getLevelOff(), LoggerLevel::OFF, 'OFF', 0 );
+ $this->doTestLevel( LoggerLevel::toLevel(LoggerLevel::OFF), LoggerLevel::OFF, 'OFF', 0 );
+ $this->doTestLevel( LoggerLevel::toLevel('OFF'), LoggerLevel::OFF, 'OFF', 0 );
}
public function testLevelFatal() {
- $this->doTestLevel( LoggerLevel::getLevelFatal(), LOG4PHP_LEVEL_FATAL_INT, 'FATAL', 0 );
- $this->doTestLevel( LoggerLevel::toLevel(LOG4PHP_LEVEL_FATAL_INT), LOG4PHP_LEVEL_FATAL_INT, 'FATAL', 0 );
- $this->doTestLevel( LoggerLevel::toLevel('FATAL'), LOG4PHP_LEVEL_FATAL_INT, 'FATAL', 0 );
+ $this->doTestLevel( LoggerLevel::getLevelFatal(), LoggerLevel::FATAL, 'FATAL', 0 );
+ $this->doTestLevel( LoggerLevel::toLevel(LoggerLevel::FATAL), LoggerLevel::FATAL, 'FATAL', 0 );
+ $this->doTestLevel( LoggerLevel::toLevel('FATAL'), LoggerLevel::FATAL, 'FATAL', 0 );
}
public function testLevelError() {
- $this->doTestLevel( LoggerLevel::getLevelError(), LOG4PHP_LEVEL_ERROR_INT, 'ERROR', 3 );
- $this->doTestLevel( LoggerLevel::toLevel(LOG4PHP_LEVEL_ERROR_INT), LOG4PHP_LEVEL_ERROR_INT, 'ERROR', 3 );
- $this->doTestLevel( LoggerLevel::toLevel('ERROR'), LOG4PHP_LEVEL_ERROR_INT, 'ERROR', 3 );
+ $this->doTestLevel( LoggerLevel::getLevelError(), LoggerLevel::ERROR, 'ERROR', 3 );
+ $this->doTestLevel( LoggerLevel::toLevel(LoggerLevel::ERROR), LoggerLevel::ERROR, 'ERROR', 3 );
+ $this->doTestLevel( LoggerLevel::toLevel('ERROR'), LoggerLevel::ERROR, 'ERROR', 3 );
}
public function testLevelWarn() {
- $this->doTestLevel( LoggerLevel::getLevelWarn(), LOG4PHP_LEVEL_WARN_INT, 'WARN', 4 );
- $this->doTestLevel( LoggerLevel::toLevel(LOG4PHP_LEVEL_WARN_INT), LOG4PHP_LEVEL_WARN_INT, 'WARN', 4 );
- $this->doTestLevel( LoggerLevel::toLevel('WARN'), LOG4PHP_LEVEL_WARN_INT, 'WARN', 4 );
+ $this->doTestLevel( LoggerLevel::getLevelWarn(), LoggerLevel::WARN, 'WARN', 4 );
+ $this->doTestLevel( LoggerLevel::toLevel(LoggerLevel::WARN), LoggerLevel::WARN, 'WARN', 4 );
+ $this->doTestLevel( LoggerLevel::toLevel('WARN'), LoggerLevel::WARN, 'WARN', 4 );
}
public function testLevelInfo() {
- $this->doTestLevel( LoggerLevel::getLevelInfo(), LOG4PHP_LEVEL_INFO_INT, 'INFO', 6 );
- $this->doTestLevel( LoggerLevel::toLevel(LOG4PHP_LEVEL_INFO_INT), LOG4PHP_LEVEL_INFO_INT, 'INFO', 6 );
- $this->doTestLevel( LoggerLevel::toLevel('INFO'), LOG4PHP_LEVEL_INFO_INT, 'INFO', 6 );
+ $this->doTestLevel( LoggerLevel::getLevelInfo(), LoggerLevel::INFO, 'INFO', 6 );
+ $this->doTestLevel( LoggerLevel::toLevel(LoggerLevel::INFO), LoggerLevel::INFO, 'INFO', 6 );
+ $this->doTestLevel( LoggerLevel::toLevel('INFO'), LoggerLevel::INFO, 'INFO', 6 );
}
public function testLevelDebug() {
- $this->doTestLevel( LoggerLevel::getLevelDebug(), LOG4PHP_LEVEL_DEBUG_INT, 'DEBUG', 7 );
- $this->doTestLevel( LoggerLevel::toLevel(LOG4PHP_LEVEL_DEBUG_INT), LOG4PHP_LEVEL_DEBUG_INT, 'DEBUG', 7 );
- $this->doTestLevel( LoggerLevel::toLevel('DEBUG'), LOG4PHP_LEVEL_DEBUG_INT, 'DEBUG', 7 );
+ $this->doTestLevel( LoggerLevel::getLevelDebug(), LoggerLevel::DEBUG, 'DEBUG', 7 );
+ $this->doTestLevel( LoggerLevel::toLevel(LoggerLevel::DEBUG), LoggerLevel::DEBUG, 'DEBUG', 7 );
+ $this->doTestLevel( LoggerLevel::toLevel('DEBUG'), LoggerLevel::DEBUG, 'DEBUG', 7 );
}
public function testLevelAll() {
- $this->doTestLevel( LoggerLevel::getLevelAll(), LOG4PHP_LEVEL_ALL_INT, 'ALL', 7 );
- $this->doTestLevel( LoggerLevel::toLevel(LOG4PHP_LEVEL_ALL_INT), LOG4PHP_LEVEL_ALL_INT, 'ALL', 7 );
- $this->doTestLevel( LoggerLevel::toLevel('ALL'), LOG4PHP_LEVEL_ALL_INT, 'ALL', 7 );
+ $this->doTestLevel( LoggerLevel::getLevelAll(), LoggerLevel::ALL, 'ALL', 7 );
+ $this->doTestLevel( LoggerLevel::toLevel(LoggerLevel::ALL), LoggerLevel::ALL, 'ALL', 7 );
+ $this->doTestLevel( LoggerLevel::toLevel('ALL'), LoggerLevel::ALL, 'ALL', 7 );
}
}