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


PHP LoggerLevel::getLevelInfo方法代码示例

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


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

示例1: testThreshold

 public function testThreshold()
 {
     Logger::configure('configurators/test1.xml');
     $root = Logger::getRootLogger();
     self::assertEquals(LoggerLevel::getLevelWarn(), $root->getLevel());
     $appender = $root->getAppender("default");
     self::assertTrue($appender instanceof LoggerAppenderEcho);
     $layout = $appender->getLayout();
     self::assertTrue($layout instanceof LoggerLayoutSimple);
     $threshold = $appender->getThreshold();
     self::assertTrue($threshold instanceof LoggerLevel);
     $e = LoggerLevel::getLevelWarn();
     self::assertEquals($e, $threshold);
     $appender = $root->getAppender("blub");
     self::assertTrue($appender instanceof LoggerAppenderEcho);
     $layout = $appender->getLayout();
     self::assertTrue($layout instanceof LoggerLayoutSimple);
     $threshold = $appender->getThreshold();
     self::assertTrue($threshold instanceof LoggerLevel);
     $e = LoggerLevel::getLevelInfo();
     self::assertEquals($e, $threshold);
     $filter = $appender->getFilter();
     self::assertTrue($filter instanceof LoggerFilterLevelRange);
     $filter2 = $filter->getNext();
     self::assertTrue($filter2 instanceof LoggerFilterDenyAll);
     $threshold = Logger::getHierarchy()->getThreshold();
     self::assertTrue($threshold instanceof LoggerLevel);
     $e = LoggerLevel::getLevelWarn();
     self::assertEquals($e, $threshold);
     $hierarchy = Logger::getHierarchy();
     $map = $hierarchy->getRendererMap();
     $clazz = $map->getByClassName('Fruit2');
     self::assertTrue($clazz instanceof FruitRenderer2);
 }
开发者ID:sacredwebsite,项目名称:scalr,代码行数:34,代码来源:LoggerConfiguratorXmlTest.php

示例2: getLoggerLevel

 public static function getLoggerLevel($level)
 {
     switch (strtolower($level)) {
         case 'trace':
             $level = LoggerLevel::getLevelTrace();
             break;
         case 'debug':
             $level = LoggerLevel::getLevelDebug();
             break;
         case 'warn':
             $level = LoggerLevel::getLevelWarn();
             break;
         case 'error':
             $level = LoggerLevel::getLevelError();
             break;
         case 'fatal':
             $level = LoggerLevel::getLevelFatal();
             break;
         case 'info':
         default:
             $level = LoggerLevel::getLevelInfo();
             break;
     }
     return $level;
 }
开发者ID:jibinam,项目名称:budabot2,代码行数:25,代码来源:LegacyLogger.class.php

示例3: testInfoLayout

 public function testInfoLayout()
 {
     $event = new LoggerLoggingEvent("LoggerLayoutXml", new Logger("TEST"), LoggerLevel::getLevelInfo(), "testmessage");
     $v = $this->formatEvent($event, $this->pattern);
     $dt = $this->getEventDateTime($event);
     $e = "{$dt} INFO  TEST (LoggerLayoutXml): testmessage in NA at NA" . PHP_EOL;
     self::assertEquals($e, $v);
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:8,代码来源:LoggerLayoutPatternTest.php

示例4: testActivateOptions

 /**
  * The Null appender does nothing - nothing to assert.
  * Just here for the sake of completness and a good testing ratio :-)
  */
 public function testActivateOptions()
 {
     $event = new LoggerLoggingEvent("LoggerAppenderNullTest", new Logger("TEST"), LoggerLevel::getLevelInfo(), "testmessage");
     $appender = new LoggerAppenderNull("TEST");
     $appender->activateOptions();
     $appender->append($event);
     $appender->close();
 }
开发者ID:keehao,项目名称:Php-Object-Framework,代码行数:12,代码来源:LoggerAppenderNullTest.php

示例5: testConfigure

 public function testConfigure()
 {
     Logger::configure('configurators/test1.php', 'LoggerConfiguratorPhp');
     $root = Logger::getRootLogger();
     self::assertEquals(LoggerLevel::getLevelWarn(), $root->getLevel());
     $appender = $root->getAppender("default");
     self::assertTrue($appender instanceof LoggerAppenderEcho);
     $layout = $appender->getLayout();
     self::assertTrue($layout instanceof LoggerLayoutSimple);
     $logger = Logger::getLogger('mylogger');
     self::assertEquals(LoggerLevel::getLevelInfo(), $logger->getLevel());
 }
开发者ID:dobreapa,项目名称:owasp-esapi-php,代码行数:12,代码来源:LoggerConfiguratorPhpTest.php

示例6: testLayoutWithLocationInfo

 public function testLayoutWithLocationInfo()
 {
     Logger::configure(array('appenders' => array('default' => array('class' => 'LoggerAppenderEcho', 'layout' => array('class' => 'LoggerLayoutSerialized', 'params' => array('locationInfo' => true)))), 'rootLogger' => array('appenders' => array('default'))));
     ob_start();
     $foo = Logger::getLogger('foo');
     $foo->info("Interesting message.");
     $actual = ob_get_contents();
     ob_end_clean();
     $event = unserialize($actual);
     self::assertInstanceOf('LoggerLoggingEvent', $event);
     self::assertEquals('Interesting message.', $event->getMessage());
     self::assertEquals(LoggerLevel::getLevelInfo(), $event->getLevel());
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:13,代码来源:LoggerLayoutSerializedTest.php

示例7: setupLogging

 private function setupLogging()
 {
     $this->logger = Logger::getLogger('Panopta API');
     $this->logger->setLevel($this->logLevel == LOG_INFO ? LoggerLevel::getLevelInfo() : LoggerLevel::getLevelDebug());
     $logAppender = new LoggerAppenderDailyFile();
     $logAppender->setFile(rtrim(rtrim($this->logPath, "/"), "\\") . DIRECTORY_SEPARATOR . "panopta_api.log");
     $logAppender->setAppend(true);
     $logAppender->setDatePattern("yyyy-MM-dd'.log'");
     $logAppender->setThreshold($this->logLevel);
     $pattern = new LoggerLayoutPattern();
     $pattern->setConversionPattern("%date - %logger - %level - %message%newline");
     $logAppender->setLayout($pattern);
     $logAppender->activateOptions();
     $this->logger->addAppender($logAppender);
 }
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:15,代码来源:api_client.php

示例8: append

 function append($event)
 {
     $level = $event->getLevel();
     $message = $event->getRenderedMessage();
     if ($level->isGreaterOrEqual(LoggerLevel::getLevelFatal())) {
         syslog(LOG_ALERT, $message);
     } elseif ($level->isGreaterOrEqual(LoggerLevel::getLevelError())) {
         syslog(LOG_ERR, $message);
     } elseif ($level->isGreaterOrEqual(LoggerLevel::getLevelWarn())) {
         syslog(LOG_WARNING, $message);
     } elseif ($level->isGreaterOrEqual(LoggerLevel::getLevelInfo())) {
         syslog(LOG_INFO, $message);
     } elseif ($level->isGreaterOrEqual(LoggerLevel::getLevelDebug())) {
         syslog(LOG_DEBUG, $message);
     }
 }
开发者ID:miztaka,项目名称:teeple2,代码行数:16,代码来源:LoggerAppenderSyslog.php

示例9: validateAll

 public function validateAll($values, $logLevel = null)
 {
     //No hay parámetros obligatorios
     $validated = array();
     foreach ($this->comparer as $key => $function) {
         if (key_exists($key, $values)) {
             $value = $values[$key];
         } else {
             $value = null;
         }
         if (call_user_func($function, $value)) {
             $validated[$key] = $value;
         } else {
             global $log;
             if ($logLevel == null) {
                 $logLevel = \LoggerLevel::getLevelInfo();
             }
             $error = "El valor '{$value}' no es válido para la key '{$key}'";
             $log->log($logLevel, $error);
             $validated[$key] = new Debug($error, array('clave' => $key, 'valor' => $value, 'comprobacion' => is_array($function) ? array_pop($function) : $function));
         }
     }
     return $validated;
 }
开发者ID:Neowedge,项目名称:RoxFramework,代码行数:24,代码来源:Validator.php

示例10: testThreshold

 public function testThreshold()
 {
     Logger::configure('configurators/test4.properties');
     $root = Logger::getRootLogger();
     self::assertEquals(LoggerLevel::getLevelWarn(), $root->getLevel());
     $appender = $root->getAppender("default");
     self::assertTrue($appender instanceof LoggerAppenderEcho);
     $layout = $appender->getLayout();
     self::assertTrue($layout instanceof LoggerLayoutSimple);
     $threshold = $appender->getThreshold();
     self::assertTrue($threshold instanceof LoggerLevel);
     $e = LoggerLevel::getLevelWarn();
     self::assertEquals($e, $threshold);
     $appender = $root->getAppender("blub");
     self::assertTrue($appender instanceof LoggerAppenderEcho);
     $layout = $appender->getLayout();
     self::assertTrue($layout instanceof LoggerLayoutSimple);
     $threshold = $appender->getThreshold();
     self::assertTrue($threshold instanceof LoggerLevel);
     $e = LoggerLevel::getLevelInfo();
     self::assertEquals($e, $threshold);
     $threshold = Logger::getHierarchy()->getThreshold();
     self::assertTrue($threshold instanceof LoggerLevel);
     $e = LoggerLevel::getLevelWarn();
     self::assertEquals($e, $threshold);
 }
开发者ID:sacredwebsite,项目名称:scalr,代码行数:26,代码来源:LoggerConfiguratorIniTest.php

示例11: isInfoEnabled

 /**
  * Check whether this Logger is enabled for the INFO Level.
  * @return boolean
  */
 public function isInfoEnabled()
 {
     return $this->isEnabledFor(LoggerLevel::getLevelInfo());
 }
开发者ID:Lyonard,项目名称:PHPExperiments,代码行数:8,代码来源:Logger.php

示例12: isInfoEnabled

 /**
  * Check whether this category is enabled for the info Level.
  * @return boolean
  * @see LoggerLevel
  */
 public function isInfoEnabled()
 {
     $infoLevel = LoggerLevel::getLevelInfo();
     if ($this->repository->isDisabled($infoLevel)) {
         return false;
     }
     return $infoLevel->isGreaterOrEqual($this->getEffectiveLevel());
 }
开发者ID:laiello,项目名称:lion-framework,代码行数:13,代码来源:Logger.php

示例13: dataLog

 /**
  * @return array[]
  */
 public function dataLog()
 {
     return array('emergency' => array('emergency', \LoggerLevel::getLevelFatal()), 'alert' => array('alert', \LoggerLevel::getLevelFatal()), 'critical' => array('critical', \LoggerLevel::getLevelFatal()), 'error' => array('error', \LoggerLevel::getLevelError()), 'warning' => array('warning', \LoggerLevel::getLevelWarn()), 'notice' => array('notice', \LoggerLevel::getLevelWarn()), 'info' => array('info', \LoggerLevel::getLevelInfo()), 'debug' => array('debug', \LoggerLevel::getLevelDebug()));
 }
开发者ID:abacaphiliac,项目名称:psr-log4php,代码行数:7,代码来源:LoggerWrapperTest.php

示例14: testAppenderThreshold

 public function testAppenderThreshold()
 {
     Logger::configure(array('rootLogger' => array('appenders' => array('default')), 'appenders' => array('default' => array('class' => 'LoggerAppenderEcho', 'threshold' => 'INFO'))));
     $actual = Logger::getRootLogger()->getAppender('default')->getThreshold();
     $expected = LoggerLevel::getLevelInfo();
     self::assertSame($expected, $actual);
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:7,代码来源:LoggerConfiguratorTest.php

示例15: append

 public function append(LoggerLoggingEvent $event)
 {
     if ($this->_option == NULL) {
         $this->_option = LOG_PID | LOG_CONS;
     }
     $level = $event->getLevel();
     if ($this->layout === null) {
         $message = $event->getRenderedMessage();
     } else {
         $message = $this->layout->format($event);
     }
     // If the priority of a syslog message can be overridden by a value defined in the properties-file,
     // use that value, else use the one that is defined in the code.
     if (!$this->dry) {
         // Attach the process ID to the message, use the facility defined in the .properties-file
         openlog($this->_ident, $this->_option, $this->_facility);
         if ($this->_overridePriority) {
             syslog($this->_priority, $message);
         } else {
             if ($level->isGreaterOrEqual(LoggerLevel::getLevelFatal())) {
                 syslog(LOG_ALERT, $message);
             } else {
                 if ($level->isGreaterOrEqual(LoggerLevel::getLevelError())) {
                     syslog(LOG_ERR, $message);
                 } else {
                     if ($level->isGreaterOrEqual(LoggerLevel::getLevelWarn())) {
                         syslog(LOG_WARNING, $message);
                     } else {
                         if ($level->isGreaterOrEqual(LoggerLevel::getLevelInfo())) {
                             syslog(LOG_INFO, $message);
                         } else {
                             if ($level->isGreaterOrEqual(LoggerLevel::getLevelDebug())) {
                                 syslog(LOG_DEBUG, $message);
                             } else {
                                 if ($level->isGreaterOrEqual(LoggerLevel::getLevelTrace())) {
                                     syslog(LOG_DEBUG, $message);
                                     // No trace level in syslog
                                 }
                             }
                         }
                     }
                 }
             }
         }
         closelog();
     } else {
         echo "DRY MODE OF SYSLOG APPENDER: " . $message;
     }
 }
开发者ID:haitao1880,项目名称:study,代码行数:49,代码来源:LoggerAppenderSyslog.php


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