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


PHP LoggerLevel::getLevelOff方法代码示例

本文整理汇总了PHP中LoggerLevel::getLevelOff方法的典型用法代码示例。如果您正苦于以下问题:PHP LoggerLevel::getLevelOff方法的具体用法?PHP LoggerLevel::getLevelOff怎么用?PHP LoggerLevel::getLevelOff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LoggerLevel的用法示例。


在下文中一共展示了LoggerLevel::getLevelOff方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: switch

 /**
  * Convert the string passed as argument to a level. If the
  * conversion fails, then this method returns a DEBUG Level.
  *
  * @param mixed $arg
  * @param LoggerLevel $default
  * @static 
  */
 function &toLevel($arg, $defaultLevel = null)
 {
     if ($defaultLevel === null) {
         return LoggerLevel::toLevel($arg, LoggerLevel::getLevelDebug());
     } else {
         if (is_int($arg)) {
             switch ($arg) {
                 case LOG4PHP_LEVEL_ALL_INT:
                     return LoggerLevel::getLevelAll();
                 case LOG4PHP_LEVEL_DEBUG_INT:
                     return LoggerLevel::getLevelDebug();
                 case LOG4PHP_LEVEL_INFO_INT:
                     return LoggerLevel::getLevelInfo();
                 case LOG4PHP_LEVEL_WARN_INT:
                     return LoggerLevel::getLevelWarn();
                 case LOG4PHP_LEVEL_ERROR_INT:
                     return LoggerLevel::getLevelError();
                 case LOG4PHP_LEVEL_FATAL_INT:
                     return LoggerLevel::getLevelFatal();
                 case LOG4PHP_LEVEL_OFF_INT:
                     return LoggerLevel::getLevelOff();
                 default:
                     return $defaultLevel;
             }
         } else {
             switch (strtoupper($arg)) {
                 case 'ALL':
                     return LoggerLevel::getLevelAll();
                 case 'DEBUG':
                     return LoggerLevel::getLevelDebug();
                 case 'INFO':
                     return LoggerLevel::getLevelInfo();
                 case 'WARN':
                     return LoggerLevel::getLevelWarn();
                 case 'ERROR':
                     return LoggerLevel::getLevelError();
                 case 'FATAL':
                     return LoggerLevel::getLevelFatal();
                 case 'OFF':
                     return LoggerLevel::getLevelOff();
                 default:
                     return $defaultLevel;
             }
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:54,代码来源:LoggerLevel.php

示例2: testLevelOff

 public function testLevelOff()
 {
     $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);
 }
开发者ID:sacredwebsite,项目名称:scalr,代码行数:6,代码来源:LoggerLevelTest.php

示例3: _convertESAPILeveltoLoggerLevel

 /**
  * Helper function.
  *
  * Converts a logging level.
  *
  * Converts the ESAPI logging level (a number) or level defined in the ESAPI
  * properties file (a string) into the levels used by Apache's log4php. Note
  * that log4php does not define a TRACE level and so TRACE is simply an
  * alias of ALL which log4php does define.
  *
  * @param int $level The logging level to convert.
  *
  * @throws Exception if the supplied level doesn't match a level currently
  *                   defined.
  *
  * @return int The log4php logging Level equivalent.
  */
 private static function _convertESAPILeveltoLoggerLevel($level)
 {
     if (is_string($level)) {
         switch (strtoupper($level)) {
             case 'ALL':
                 /* Same as TRACE */
             /* Same as TRACE */
             case 'TRACE':
                 return LoggerLevel::getLevelAll();
             case 'DEBUG':
                 return LoggerLevel::getLevelDebug();
             case 'INFO':
                 return LoggerLevel::getLevelInfo();
             case 'WARN':
                 return LoggerLevel::getLevelWarn();
             case 'ERROR':
                 return LoggerLevel::getLevelError();
             case 'FATAL':
                 return LoggerLevel::getLevelFatal();
             case 'OFF':
                 return LoggerLevel::getLevelOff();
             default:
                 throw new Exception("Invalid logging level Value was: {$level}");
         }
     } else {
         switch ($level) {
             case Auditor::ALL:
                 /* Same as TRACE */
             /* Same as TRACE */
             case Auditor::TRACE:
                 return LoggerLevel::getLevelAll();
             case Auditor::DEBUG:
                 return LoggerLevel::getLevelDebug();
             case Auditor::INFO:
                 return LoggerLevel::getLevelInfo();
             case Auditor::WARNING:
                 return LoggerLevel::getLevelWarn();
             case Auditor::ERROR:
                 return LoggerLevel::getLevelError();
             case Auditor::FATAL:
                 return LoggerLevel::getLevelFatal();
             case Auditor::OFF:
                 return LoggerLevel::getLevelOff();
             default:
                 throw new Exception("Invalid logging level Value was: {$level}");
         }
     }
 }
开发者ID:najamelan,项目名称:PHP-ESAPI,代码行数:65,代码来源:DefaultAuditor.php


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