本文整理汇总了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;
}
}
}
}
示例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);
}
示例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}");
}
}
}