[Vtigercrm-commits] [vtiger-commits] r5736 - in /vtigercrm/trunk/log4php/varia: LoggerDenyAllFilter.php LoggerLevelMatchFilter.php LoggerLevelRangeFilter.php LoggerStringMatchFilter.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu May 4 00:18:43 EDT 2006
Author: saraj
Date: Wed May 3 22:18:30 2006
New Revision: 5736
Log:
log4php latest version has been update
Modified:
vtigercrm/trunk/log4php/varia/LoggerDenyAllFilter.php
vtigercrm/trunk/log4php/varia/LoggerLevelMatchFilter.php
vtigercrm/trunk/log4php/varia/LoggerLevelRangeFilter.php
vtigercrm/trunk/log4php/varia/LoggerStringMatchFilter.php
Modified: vtigercrm/trunk/log4php/varia/LoggerDenyAllFilter.php
==============================================================================
--- vtigercrm/trunk/log4php/varia/LoggerDenyAllFilter.php (original)
+++ vtigercrm/trunk/log4php/varia/LoggerDenyAllFilter.php Wed May 3 22:18:30 2006
@@ -1,57 +1,57 @@
-<?php
-/**
- * log4php is a PHP port of the log4j java logging package.
- *
- * <p>This framework is based on log4j (see {@link http://jakarta.apache.org/log4j log4j} for details).</p>
- * <p>Design, strategies and part of the methods documentation are developed by log4j team
- * (Ceki Gülcü as log4j project founder and
- * {@link http://jakarta.apache.org/log4j/docs/contributors.html contributors}).</p>
- *
- * <p>PHP port, extensions and modifications by VxR. All rights reserved.<br>
- * For more information, please see {@link http://www.vxr.it/log4php/}.</p>
- *
- * <p>This software is published under the terms of the LGPL License
- * a copy of which has been included with this distribution in the LICENSE file.</p>
- *
- * @package log4php
- * @subpackage varia
- */
-
-/**
- * @ignore
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
-/**
- */
-require_once(LOG4PHP_DIR . '/spi/LoggerFilter.php');
-
-/**
- * This filter drops all logging events.
- *
- * <p>You can add this filter to the end of a filter chain to
- * switch from the default "accept all unless instructed otherwise"
- * filtering behaviour to a "deny all unless instructed otherwise"
- * behaviour.</p>
- *
- * @author VxR <vxr at vxr.it>
- * @version $Revision: 1.1 $
- * @package log4php
- * @subpackage varia
- * @since 0.3
- */
-class LoggerDenyAllFilter extends LoggerFilter {
-
- /**
- * Always returns the integer constant {@link LOG4PHP_LOGGER_FILTER_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}
- */
- function decide($event)
- {
- return LOG4PHP_LOGGER_FILTER_DENY;
- }
-}
+<?php
+/**
+ * log4php is a PHP port of the log4j java logging package.
+ *
+ * <p>This framework is based on log4j (see {@link http://jakarta.apache.org/log4j log4j} for details).</p>
+ * <p>Design, strategies and part of the methods documentation are developed by log4j team
+ * (Ceki Gülcü as log4j project founder and
+ * {@link http://jakarta.apache.org/log4j/docs/contributors.html contributors}).</p>
+ *
+ * <p>PHP port, extensions and modifications by VxR. All rights reserved.<br>
+ * For more information, please see {@link http://www.vxr.it/log4php/}.</p>
+ *
+ * <p>This software is published under the terms of the LGPL License
+ * a copy of which has been included with this distribution in the LICENSE file.</p>
+ *
+ * @package log4php
+ * @subpackage varia
+ */
+
+/**
+ * @ignore
+ */
+if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
+
+/**
+ */
+require_once(LOG4PHP_DIR . '/spi/LoggerFilter.php');
+
+/**
+ * This filter drops all logging events.
+ *
+ * <p>You can add this filter to the end of a filter chain to
+ * switch from the default "accept all unless instructed otherwise"
+ * filtering behaviour to a "deny all unless instructed otherwise"
+ * behaviour.</p>
+ *
+ * @author VxR <vxr at vxr.it>
+ * @version $Revision: 1.4 $
+ * @package log4php
+ * @subpackage varia
+ * @since 0.3
+ */
+class LoggerDenyAllFilter extends LoggerFilter {
+
+ /**
+ * Always returns the integer constant {@link LOG4PHP_LOGGER_FILTER_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}
+ */
+ function decide($event)
+ {
+ return LOG4PHP_LOGGER_FILTER_DENY;
+ }
+}
?>
Modified: vtigercrm/trunk/log4php/varia/LoggerLevelMatchFilter.php
==============================================================================
--- vtigercrm/trunk/log4php/varia/LoggerLevelMatchFilter.php (original)
+++ vtigercrm/trunk/log4php/varia/LoggerLevelMatchFilter.php Wed May 3 22:18:30 2006
@@ -1,119 +1,119 @@
-<?php
-/**
- * log4php is a PHP port of the log4j java logging package.
- *
- * <p>This framework is based on log4j (see {@link http://jakarta.apache.org/log4j log4j} for details).</p>
- * <p>Design, strategies and part of the methods documentation are developed by log4j team
- * (Ceki Gülcü as log4j project founder and
- * {@link http://jakarta.apache.org/log4j/docs/contributors.html contributors}).</p>
- *
- * <p>PHP port, extensions and modifications by VxR. All rights reserved.<br>
- * For more information, please see {@link http://www.vxr.it/log4php/}.</p>
- *
- * <p>This software is published under the terms of the LGPL License
- * a copy of which has been included with this distribution in the LICENSE file.</p>
- *
- * @package log4php
- * @subpackage varia
- */
-
-/**
- * @ignore
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
-/**
- */
-require_once(LOG4PHP_DIR . '/helpers/LoggerOptionConverter.php');
-require_once(LOG4PHP_DIR . '/spi/LoggerFilter.php');
-
-/**
- * This is a very simple filter based on level matching.
- *
- * <p>The filter admits two options <b><var>LevelToMatch</var></b> and
- * <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>
- * 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>
- *
- * @author VxR <vxr at vxr.it>
- * @version $Revision: 1.1 $
- * @package log4php
- * @subpackage varia
- * @since 0.6
- */
-class LoggerLevelMatchFilter extends LoggerFilter {
-
- /**
- * @var boolean
- */
- var $acceptOnMatch = true;
-
- /**
- * @var LoggerLevel
- */
- var $levelToMatch;
-
- /**
- * @return boolean
- */
- function getAcceptOnMatch()
- {
- return $this->acceptOnMatch;
- }
-
- /**
- * @param boolean $acceptOnMatch
- */
- function setAcceptOnMatch($acceptOnMatch)
- {
- $this->acceptOnMatch = LoggerOptionConverter::toBoolean($acceptOnMatch, true);
- }
-
- /**
- * @return LoggerLevel
- */
- function getLevelToMatch()
- {
- return $this->levelToMatch;
- }
-
- /**
- * @param string $l the level to match
- */
- function setLevelToMatch($l)
- {
- $this->levelToMatch = LoggerOptionConverter::toLevel($l, null);
- }
-
- /**
- * Return the decision of this filter.
- *
- * Returns {@link LOG4PHP_LOGGER_FILTER_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
- * <b><var>AcceptOnMatch</var></b> property is set to <i>true</i>. The
- * returned decision is {@link LOG4PHP_LOGGER_FILTER_DENY} if the
- * <b><var>AcceptOnMatch</var></b> property is set to <i>false</i>.
- *
- * @param LoggerLoggingEvent $event
- * @return integer
- */
- function decide($event)
- {
- if($this->levelToMatch === null)
- return LOG4PHP_LOGGER_FILTER_NEUTRAL;
-
- if ($this->levelToMatch->equals($event->getLevel())) {
- return $this->getAcceptOnMatch() ?
- LOG4PHP_LOGGER_FILTER_ACCEPT :
- LOG4PHP_LOGGER_FILTER_DENY;
- } else {
- return LOG4PHP_LOGGER_FILTER_NEUTRAL;
- }
- }
-}
+<?php
+/**
+ * log4php is a PHP port of the log4j java logging package.
+ *
+ * <p>This framework is based on log4j (see {@link http://jakarta.apache.org/log4j log4j} for details).</p>
+ * <p>Design, strategies and part of the methods documentation are developed by log4j team
+ * (Ceki Gülcü as log4j project founder and
+ * {@link http://jakarta.apache.org/log4j/docs/contributors.html contributors}).</p>
+ *
+ * <p>PHP port, extensions and modifications by VxR. All rights reserved.<br>
+ * For more information, please see {@link http://www.vxr.it/log4php/}.</p>
+ *
+ * <p>This software is published under the terms of the LGPL License
+ * a copy of which has been included with this distribution in the LICENSE file.</p>
+ *
+ * @package log4php
+ * @subpackage varia
+ */
+
+/**
+ * @ignore
+ */
+if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
+
+/**
+ */
+require_once(LOG4PHP_DIR . '/helpers/LoggerOptionConverter.php');
+require_once(LOG4PHP_DIR . '/spi/LoggerFilter.php');
+
+/**
+ * This is a very simple filter based on level matching.
+ *
+ * <p>The filter admits two options <b><var>LevelToMatch</var></b> and
+ * <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>
+ * 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>
+ *
+ * @author VxR <vxr at vxr.it>
+ * @version $Revision: 1.2 $
+ * @package log4php
+ * @subpackage varia
+ * @since 0.6
+ */
+class LoggerLevelMatchFilter extends LoggerFilter {
+
+ /**
+ * @var boolean
+ */
+ var $acceptOnMatch = true;
+
+ /**
+ * @var LoggerLevel
+ */
+ var $levelToMatch;
+
+ /**
+ * @return boolean
+ */
+ function getAcceptOnMatch()
+ {
+ return $this->acceptOnMatch;
+ }
+
+ /**
+ * @param boolean $acceptOnMatch
+ */
+ function setAcceptOnMatch($acceptOnMatch)
+ {
+ $this->acceptOnMatch = LoggerOptionConverter::toBoolean($acceptOnMatch, true);
+ }
+
+ /**
+ * @return LoggerLevel
+ */
+ function getLevelToMatch()
+ {
+ return $this->levelToMatch;
+ }
+
+ /**
+ * @param string $l the level to match
+ */
+ function setLevelToMatch($l)
+ {
+ $this->levelToMatch = LoggerOptionConverter::toLevel($l, null);
+ }
+
+ /**
+ * Return the decision of this filter.
+ *
+ * Returns {@link LOG4PHP_LOGGER_FILTER_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
+ * <b><var>AcceptOnMatch</var></b> property is set to <i>true</i>. The
+ * returned decision is {@link LOG4PHP_LOGGER_FILTER_DENY} if the
+ * <b><var>AcceptOnMatch</var></b> property is set to <i>false</i>.
+ *
+ * @param LoggerLoggingEvent $event
+ * @return integer
+ */
+ function decide($event)
+ {
+ if($this->levelToMatch === null)
+ return LOG4PHP_LOGGER_FILTER_NEUTRAL;
+
+ if ($this->levelToMatch->equals($event->getLevel())) {
+ return $this->getAcceptOnMatch() ?
+ LOG4PHP_LOGGER_FILTER_ACCEPT :
+ LOG4PHP_LOGGER_FILTER_DENY;
+ } else {
+ return LOG4PHP_LOGGER_FILTER_NEUTRAL;
+ }
+ }
+}
?>
Modified: vtigercrm/trunk/log4php/varia/LoggerLevelRangeFilter.php
==============================================================================
--- vtigercrm/trunk/log4php/varia/LoggerLevelRangeFilter.php (original)
+++ vtigercrm/trunk/log4php/varia/LoggerLevelRangeFilter.php Wed May 3 22:18:30 2006
@@ -1,168 +1,168 @@
-<?php
-/**
- * log4php is a PHP port of the log4j java logging package.
- *
- * <p>This framework is based on log4j (see {@link http://jakarta.apache.org/log4j log4j} for details).</p>
- * <p>Design, strategies and part of the methods documentation are developed by log4j team
- * (Ceki Gülcü as log4j project founder and
- * {@link http://jakarta.apache.org/log4j/docs/contributors.html contributors}).</p>
- *
- * <p>PHP port, extensions and modifications by VxR. All rights reserved.<br>
- * For more information, please see {@link http://www.vxr.it/log4php/}.</p>
- *
- * <p>This software is published under the terms of the LGPL License
- * a copy of which has been included with this distribution in the LICENSE file.</p>
- *
- * @package log4php
- * @subpackage varia
- */
-
-/**
- * @ignore
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
-/**
- */
-require_once(LOG4PHP_DIR . '/helpers/LoggerOptionConverter.php');
-require_once(LOG4PHP_DIR . '/spi/LoggerFilter.php');
-
-/**
- * This is a very simple filter based on level matching, which can be
- * used to reject messages with priorities outside a certain range.
- *
- * <p>The filter admits three options <b><var>LevelMin</var></b>, <b><var>LevelMax</var></b>
- * 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>
- *
- * <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
- * <b><var>AcceptOnMatch</var></b> is <i>false</i>,
- * {@link LOG4PHP_LOGGER_FILTER_NEUTRAL} is returned.</p>
- *
- * <p>If <b><var>LevelMin</var></b> is not defined, then there is no
- * minimum acceptable level (ie a level is never rejected for
- * being too "low"/unimportant). If <b><var>LevelMax</var></b> is not
- * defined, then there is no maximum acceptable level (ie a
- * level is never rejected for beeing too "high"/important).</p>
- *
- * <p>Refer to the {@link LoggerAppenderSkeleton::setThreshold()} method
- * available to <b>all</b> appenders extending {@link LoggerAppenderSkeleton}
- * for a more convenient way to filter out events by level.</p>
- *
- * @log4j-class org.apache.log4j.varia.LevelRangeFilter
- * @log4j-author Simon Kitching
- * @log4j-author based on code by Ceki Gülcü
- *
- * @author VxR <vxr at vxr.it>
- * @version $Revision: 1.1 $
- * @package log4php
- * @subpackage varia
- * @since 0.6
- */
-class LoggerLevelRangeFilter extends LoggerFilter {
-
- /**
- * @var boolean
- */
- var $acceptOnMatch = true;
-
- /**
- * @var LoggerLevel
- */
- var $levelMin;
-
- /**
- * @var LoggerLevel
- */
- var $levelMax;
-
- /**
- * @return boolean
- */
- function getAcceptOnMatch()
- {
- return $this->acceptOnMatch;
- }
-
- /**
- * @param boolean $acceptOnMatch
- */
- function setAcceptOnMatch($acceptOnMatch)
- {
- $this->acceptOnMatch = LoggerOptionConverter::toBoolean($acceptOnMatch, true);
- }
-
- /**
- * @return LoggerLevel
- */
- function getLevelMin()
- {
- return $this->levelMin;
- }
-
- /**
- * @param string $l the level min to match
- */
- function setLevelMin($l)
- {
- $this->levelMin = LoggerOptionConverter::toLevel($l, null);
- }
-
- /**
- * @return LoggerLevel
- */
- function getLevelMax()
- {
- return $this->levelMax;
- }
-
- /**
- * @param string $l the level max to match
- */
- function setLevelMax($l)
- {
- $this->levelMax = LoggerOptionConverter::toLevel($l, null);
- }
-
- /**
- * Return the decision of this filter.
- *
- * @param LoggerLoggingEvent $event
- * @return integer
- */
- function decide($event)
- {
- $level = $event->getLevel();
-
- if($this->levelMin !== null) {
- if ($level->isGreaterOrEqual($this->levelMin) == false) {
- // level of event is less than minimum
- return LOG4PHP_LOGGER_FILTER_DENY;
- }
- }
-
- if($this->levelMax !== null) {
- if ($level->toInt() > $this->levelMax->toInt()) {
- // level of event is greater than maximum
- // 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;
- }
- }
-
- if ($this->getAcceptOnMatch()) {
- // this filter set up to bypass later filters and always return
- // accept if level in range
- return LOG4PHP_LOGGER_FILTER_ACCEPT;
- } else {
- // event is ok for this filter; allow later filters to have a look..
- return LOG4PHP_LOGGER_FILTER_NEUTRAL;
- }
- }
-}
+<?php
+/**
+ * log4php is a PHP port of the log4j java logging package.
+ *
+ * <p>This framework is based on log4j (see {@link http://jakarta.apache.org/log4j log4j} for details).</p>
+ * <p>Design, strategies and part of the methods documentation are developed by log4j team
+ * (Ceki Gülcü as log4j project founder and
+ * {@link http://jakarta.apache.org/log4j/docs/contributors.html contributors}).</p>
+ *
+ * <p>PHP port, extensions and modifications by VxR. All rights reserved.<br>
+ * For more information, please see {@link http://www.vxr.it/log4php/}.</p>
+ *
+ * <p>This software is published under the terms of the LGPL License
+ * a copy of which has been included with this distribution in the LICENSE file.</p>
+ *
+ * @package log4php
+ * @subpackage varia
+ */
+
+/**
+ * @ignore
+ */
+if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
+
+/**
+ */
+require_once(LOG4PHP_DIR . '/helpers/LoggerOptionConverter.php');
+require_once(LOG4PHP_DIR . '/spi/LoggerFilter.php');
+
+/**
+ * This is a very simple filter based on level matching, which can be
+ * used to reject messages with priorities outside a certain range.
+ *
+ * <p>The filter admits three options <b><var>LevelMin</var></b>, <b><var>LevelMax</var></b>
+ * 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>
+ *
+ * <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
+ * <b><var>AcceptOnMatch</var></b> is <i>false</i>,
+ * {@link LOG4PHP_LOGGER_FILTER_NEUTRAL} is returned.</p>
+ *
+ * <p>If <b><var>LevelMin</var></b> is not defined, then there is no
+ * minimum acceptable level (ie a level is never rejected for
+ * being too "low"/unimportant). If <b><var>LevelMax</var></b> is not
+ * defined, then there is no maximum acceptable level (ie a
+ * level is never rejected for beeing too "high"/important).</p>
+ *
+ * <p>Refer to the {@link LoggerAppenderSkeleton::setThreshold()} method
+ * available to <b>all</b> appenders extending {@link LoggerAppenderSkeleton}
+ * for a more convenient way to filter out events by level.</p>
+ *
+ * @log4j-class org.apache.log4j.varia.LevelRangeFilter
+ * @log4j-author Simon Kitching
+ * @log4j-author based on code by Ceki Gülcü
+ *
+ * @author VxR <vxr at vxr.it>
+ * @version $Revision: 1.2 $
+ * @package log4php
+ * @subpackage varia
+ * @since 0.6
+ */
+class LoggerLevelRangeFilter extends LoggerFilter {
+
+ /**
+ * @var boolean
+ */
+ var $acceptOnMatch = true;
+
+ /**
+ * @var LoggerLevel
+ */
+ var $levelMin;
+
+ /**
+ * @var LoggerLevel
+ */
+ var $levelMax;
+
+ /**
+ * @return boolean
+ */
+ function getAcceptOnMatch()
+ {
+ return $this->acceptOnMatch;
+ }
+
+ /**
+ * @param boolean $acceptOnMatch
+ */
+ function setAcceptOnMatch($acceptOnMatch)
+ {
+ $this->acceptOnMatch = LoggerOptionConverter::toBoolean($acceptOnMatch, true);
+ }
+
+ /**
+ * @return LoggerLevel
+ */
+ function getLevelMin()
+ {
+ return $this->levelMin;
+ }
+
+ /**
+ * @param string $l the level min to match
+ */
+ function setLevelMin($l)
+ {
+ $this->levelMin = LoggerOptionConverter::toLevel($l, null);
+ }
+
+ /**
+ * @return LoggerLevel
+ */
+ function getLevelMax()
+ {
+ return $this->levelMax;
+ }
+
+ /**
+ * @param string $l the level max to match
+ */
+ function setLevelMax($l)
+ {
+ $this->levelMax = LoggerOptionConverter::toLevel($l, null);
+ }
+
+ /**
+ * Return the decision of this filter.
+ *
+ * @param LoggerLoggingEvent $event
+ * @return integer
+ */
+ function decide($event)
+ {
+ $level = $event->getLevel();
+
+ if($this->levelMin !== null) {
+ if ($level->isGreaterOrEqual($this->levelMin) == false) {
+ // level of event is less than minimum
+ return LOG4PHP_LOGGER_FILTER_DENY;
+ }
+ }
+
+ if($this->levelMax !== null) {
+ if ($level->toInt() > $this->levelMax->toInt()) {
+ // level of event is greater than maximum
+ // 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;
+ }
+ }
+
+ if ($this->getAcceptOnMatch()) {
+ // this filter set up to bypass later filters and always return
+ // accept if level in range
+ return LOG4PHP_LOGGER_FILTER_ACCEPT;
+ } else {
+ // event is ok for this filter; allow later filters to have a look..
+ return LOG4PHP_LOGGER_FILTER_NEUTRAL;
+ }
+ }
+}
?>
Modified: vtigercrm/trunk/log4php/varia/LoggerStringMatchFilter.php
==============================================================================
--- vtigercrm/trunk/log4php/varia/LoggerStringMatchFilter.php (original)
+++ vtigercrm/trunk/log4php/varia/LoggerStringMatchFilter.php Wed May 3 22:18:30 2006
@@ -1,108 +1,108 @@
-<?php
-/**
- * log4php is a PHP port of the log4j java logging package.
- *
- * <p>This framework is based on log4j (see {@link http://jakarta.apache.org/log4j log4j} for details).</p>
- * <p>Design, strategies and part of the methods documentation are developed by log4j team
- * (Ceki Gülcü as log4j project founder and
- * {@link http://jakarta.apache.org/log4j/docs/contributors.html contributors}).</p>
- *
- * <p>PHP port, extensions and modifications by VxR. All rights reserved.<br>
- * For more information, please see {@link http://www.vxr.it/log4php/}.</p>
- *
- * <p>This software is published under the terms of the LGPL License
- * a copy of which has been included with this distribution in the LICENSE file.</p>
- *
- * @package log4php
- * @subpackage varia
- */
-
-/**
- * @ignore
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
-/**
- */
-require_once(LOG4PHP_DIR . '/spi/LoggerFilter.php');
-
-/**
- * This is a very simple filter based on string matching.
- *
- * <p>The filter admits two options {@link $stringToMatch} and
- * {@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
- * 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}
- * is returned.</p>
- *
- * @author VxR <vxr at vxr.it>
- * @version $Revision: 1.1 $
- * @package log4php
- * @subpackage varia
- * @since 0.3
- */
-class LoggerStringMatchFilter extends LoggerFilter {
-
- /**
- * @var boolean
- */
- var $acceptOnMatch = true;
-
- /**
- * @var string
- */
- var $stringToMatch = null;
-
- /**
- * @return boolean
- */
- function getAcceptOnMatch()
- {
- return $this->acceptOnMatch;
- }
-
- /**
- * @param mixed $acceptOnMatch a boolean or a string ('true' or 'false')
- */
- function setAcceptOnMatch($acceptOnMatch)
- {
- $this->acceptOnMatch = is_bool($acceptOnMatch) ?
- $acceptOnMatch :
- (bool)(strtolower($acceptOnMatch) == 'true');
- }
-
- /**
- * @return string
- */
- function getStringToMatch()
- {
- return $this->stringToMatch;
- }
-
- /**
- * @param string $s the string to match
- */
- function setStringToMatch($s)
- {
- $this->stringToMatch = $s;
- }
-
- /**
- * @return integer a {@link LOGGER_FILTER_NEUTRAL} is there is no string match.
- */
- function decide($event)
- {
- $msg = $event->getRenderedMessage();
-
- if($msg === null or $this->stringToMatch === null)
- return LOG4PHP_LOGGER_FILTER_NEUTRAL;
- if( strpos($msg, $this->stringToMatch) !== false ) {
- return ($this->acceptOnMatch) ? LOG4PHP_LOGGER_FILTER_ACCEPT : LOG4PHP_LOGGER_FILTER_DENY ;
- }
- return LOG4PHP_LOGGER_FILTER_NEUTRAL;
- }
-}
+<?php
+/**
+ * log4php is a PHP port of the log4j java logging package.
+ *
+ * <p>This framework is based on log4j (see {@link http://jakarta.apache.org/log4j log4j} for details).</p>
+ * <p>Design, strategies and part of the methods documentation are developed by log4j team
+ * (Ceki Gülcü as log4j project founder and
+ * {@link http://jakarta.apache.org/log4j/docs/contributors.html contributors}).</p>
+ *
+ * <p>PHP port, extensions and modifications by VxR. All rights reserved.<br>
+ * For more information, please see {@link http://www.vxr.it/log4php/}.</p>
+ *
+ * <p>This software is published under the terms of the LGPL License
+ * a copy of which has been included with this distribution in the LICENSE file.</p>
+ *
+ * @package log4php
+ * @subpackage varia
+ */
+
+/**
+ * @ignore
+ */
+if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
+
+/**
+ */
+require_once(LOG4PHP_DIR . '/spi/LoggerFilter.php');
+
+/**
+ * This is a very simple filter based on string matching.
+ *
+ * <p>The filter admits two options {@link $stringToMatch} and
+ * {@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
+ * 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}
+ * is returned.</p>
+ *
+ * @author VxR <vxr at vxr.it>
+ * @version $Revision: 1.4 $
+ * @package log4php
+ * @subpackage varia
+ * @since 0.3
+ */
+class LoggerStringMatchFilter extends LoggerFilter {
+
+ /**
+ * @var boolean
+ */
+ var $acceptOnMatch = true;
+
+ /**
+ * @var string
+ */
+ var $stringToMatch = null;
+
+ /**
+ * @return boolean
+ */
+ function getAcceptOnMatch()
+ {
+ return $this->acceptOnMatch;
+ }
+
+ /**
+ * @param mixed $acceptOnMatch a boolean or a string ('true' or 'false')
+ */
+ function setAcceptOnMatch($acceptOnMatch)
+ {
+ $this->acceptOnMatch = is_bool($acceptOnMatch) ?
+ $acceptOnMatch :
+ (bool)(strtolower($acceptOnMatch) == 'true');
+ }
+
+ /**
+ * @return string
+ */
+ function getStringToMatch()
+ {
+ return $this->stringToMatch;
+ }
+
+ /**
+ * @param string $s the string to match
+ */
+ function setStringToMatch($s)
+ {
+ $this->stringToMatch = $s;
+ }
+
+ /**
+ * @return integer a {@link LOGGER_FILTER_NEUTRAL} is there is no string match.
+ */
+ function decide($event)
+ {
+ $msg = $event->getRenderedMessage();
+
+ if($msg === null or $this->stringToMatch === null)
+ return LOG4PHP_LOGGER_FILTER_NEUTRAL;
+ if( strpos($msg, $this->stringToMatch) !== false ) {
+ return ($this->acceptOnMatch) ? LOG4PHP_LOGGER_FILTER_ACCEPT : LOG4PHP_LOGGER_FILTER_DENY ;
+ }
+ return LOG4PHP_LOGGER_FILTER_NEUTRAL;
+ }
+}
?>
More information about the vtigercrm-commits
mailing list