本文整理汇总了PHP中LoggerLevel::toInt方法的典型用法代码示例。如果您正苦于以下问题:PHP LoggerLevel::toInt方法的具体用法?PHP LoggerLevel::toInt怎么用?PHP LoggerLevel::toInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LoggerLevel
的用法示例。
在下文中一共展示了LoggerLevel::toInt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: decide
/**
* Return the decision of this filter.
*
* @param LoggerLoggingEvent $event
* @return integer
*/
public function decide(LoggerLoggingEvent $event)
{
$level = $event->getLevel();
if ($this->levelMin !== null) {
if ($level->isGreaterOrEqual($this->levelMin) == false) {
// level of event is less than minimum
return LoggerFilter::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 LoggerFilter::DENY;
}
}
if ($this->acceptOnMatch) {
// this filter set up to bypass later filters and always return
// accept if level in range
return LoggerFilter::ACCEPT;
} else {
// event is ok for this filter; allow later filters to have a look..
return LoggerFilter::NEUTRAL;
}
}
示例2: isDisabled
/**
* Returns true if the hierarchy is disabled for given log level and false
* otherwise.
* @return boolean
*/
public function isDisabled(LoggerLevel $level)
{
return $this->threshold->toInt() > $level->toInt();
}
示例3: getGELFLevel
protected function getGELFLevel(LoggerLevel $level)
{
$int = $level->toInt();
if (isset($this->_levelMap[$int])) {
return $this->_levelMap[$int];
} else {
return self::DEBUG;
}
}
示例4: getSyslogPriority
/** Determines which syslog priority to use based on the given level. */
private function getSyslogPriority(LoggerLevel $level)
{
if ($this->overridePriority) {
return $this->intPriority;
}
$int = $level->toInt();
if (isset($this->levelMap[$int])) {
return $this->levelMap[$int];
} else {
return LOG_DEBUG;
}
}
示例5: getGelfLevel
/**
* @param LoggerLevel $level
* @return int
*/
public function getGelfLevel(LoggerLevel $level)
{
$int = $level->toInt();
if (isset($this->levelMap[$int])) {
return $this->levelMap[$int];
} else {
return self::LEVEL_ALERT;
}
}