本文整理汇总了PHP中LoggerLevel::equals方法的典型用法代码示例。如果您正苦于以下问题:PHP LoggerLevel::equals方法的具体用法?PHP LoggerLevel::equals怎么用?PHP LoggerLevel::equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LoggerLevel
的用法示例。
在下文中一共展示了LoggerLevel::equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: decide
/**
* Return the decision of this filter.
*
* 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 LoggerFilter::ACCEPT} if the
* <b><var>AcceptOnMatch</var></b> property is set to <i>true</i>. The
* returned decision is {@link LoggerFilter::DENY} if the
* <b><var>AcceptOnMatch</var></b> property is set to <i>false</i>.
*
* @param LoggerLoggingEvent $event
* @return integer
*/
public function decide(LoggerLoggingEvent $event)
{
if ($this->levelToMatch === null) {
return LoggerFilter::NEUTRAL;
}
if ($this->levelToMatch->equals($event->getLevel())) {
return $this->acceptOnMatch ? LoggerFilter::ACCEPT : LoggerFilter::DENY;
} else {
return LoggerFilter::NEUTRAL;
}
}
示例2: decide
/**
* 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;
}
}