当前位置: 首页>>代码示例>>PHP>>正文


PHP LoggerLevel::toInt方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:AnvilStriker,项目名称:owasp-esapi-php,代码行数:33,代码来源:LoggerFilterLevelRange.php

示例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();
 }
开发者ID:jjaferson,项目名称:ourives,代码行数:9,代码来源:LoggerHierarchy.php

示例3: getGELFLevel

 protected function getGELFLevel(LoggerLevel $level)
 {
     $int = $level->toInt();
     if (isset($this->_levelMap[$int])) {
         return $this->_levelMap[$int];
     } else {
         return self::DEBUG;
     }
 }
开发者ID:rurri,项目名称:log4php-graylog2,代码行数:9,代码来源:LoggerLayoutGelf.php

示例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;
     }
 }
开发者ID:jquedena,项目名称:explora-titania,代码行数:13,代码来源:LoggerAppenderSyslog.php

示例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;
     }
 }
开发者ID:wikimart,项目名称:log4php-graylog2,代码行数:13,代码来源:LoggerLayoutGelf.php


注:本文中的LoggerLevel::toInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。