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


PHP LoggerLevel::getLevelDebug方法代码示例

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


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

示例1: testConstructWithTimestamp

 public function testConstructWithTimestamp()
 {
     $l = LoggerLevel::getLevelDebug();
     $timestamp = microtime(true);
     $e = new LoggerLoggingEvent('fqcn', 'TestLogger', $l, 'test', $timestamp);
     self::assertEquals($e->getTimeStamp(), $timestamp);
 }
开发者ID:keehao,项目名称:Php-Object-Framework,代码行数:7,代码来源:LoggerLoggingEventTest.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: testDebugLayout

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

示例4: testPhp

 public function testPhp()
 {
     $appender = new LoggerAppenderPhp("TEST");
     $layout = new LoggerLayoutSimple();
     $appender->setLayout($layout);
     $appender->activateOptions();
     $event = new LoggerLoggingEvent("LoggerAppenderPhpTest", new Logger("TEST"), LoggerLevel::getLevelError(), "testmessage");
     $appender->append($event);
     $event = new LoggerLoggingEvent("LoggerAppenderPhpTest", new Logger("TEST"), LoggerLevel::getLevelWarn(), "testmessage");
     $appender->append($event);
     $event = new LoggerLoggingEvent("LoggerAppenderPhpTest", new Logger("TEST"), LoggerLevel::getLevelDebug(), "testmessage");
     $appender->append($event);
 }
开发者ID:dobreapa,项目名称:owasp-esapi-php,代码行数:13,代码来源:LoggerAppenderPhpTest.php

示例5: testDecide

 public function testDecide()
 {
     $filter = new LoggerFilterDenyAll();
     $eventError = new LoggerLoggingEvent("LoggerAppenderEchoTest", new Logger("TEST"), LoggerLevel::getLevelError(), "testmessage");
     $eventDebug = new LoggerLoggingEvent("LoggerAppenderEchoTest", new Logger("TEST"), LoggerLevel::getLevelDebug(), "testmessage");
     $eventWarn = new LoggerLoggingEvent("LoggerAppenderEchoTest", new Logger("TEST"), LoggerLevel::getLevelWarn(), "testmessage");
     $result = $filter->decide($eventError);
     self::assertEquals($result, LoggerFilter::DENY);
     $result = $filter->decide($eventDebug);
     self::assertEquals($result, LoggerFilter::DENY);
     $result = $filter->decide($eventWarn);
     self::assertEquals($result, LoggerFilter::DENY);
 }
开发者ID:sacredwebsite,项目名称:scalr,代码行数:13,代码来源:LoggerFilterDenyAllTest.php

示例6: testDecide

 public function testDecide()
 {
     $filter = new MyFilter();
     // activateOptions is empty, but should at least throw no exeception
     $filter->activateOptions();
     $eventError = new LoggerLoggingEvent("LoggerAppenderEchoTest", new Logger("TEST"), LoggerLevel::getLevelError(), "testmessage");
     $eventDebug = new LoggerLoggingEvent("LoggerAppenderEchoTest", new Logger("TEST"), LoggerLevel::getLevelDebug(), "testmessage");
     $eventWarn = new LoggerLoggingEvent("LoggerAppenderEchoTest", new Logger("TEST"), LoggerLevel::getLevelWarn(), "testmessage");
     $result = $filter->decide($eventError);
     self::assertEquals($result, LoggerFilter::NEUTRAL);
     $result = $filter->decide($eventDebug);
     self::assertEquals($result, LoggerFilter::NEUTRAL);
     $result = $filter->decide($eventWarn);
     self::assertEquals($result, LoggerFilter::NEUTRAL);
 }
开发者ID:keehao,项目名称:Php-Object-Framework,代码行数:15,代码来源:LoggerFilterTest.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: testDecideAcceptFalse

 public function testDecideAcceptFalse()
 {
     $filter = new LoggerFilterLevelRange();
     $filter->setAcceptOnMatch("false");
     $filter->setLevelMin(LoggerLevel::getLevelWarn());
     $filter->setLevelMax(LoggerLevel::getLevelError());
     $eventError = new LoggerLoggingEvent("LoggerAppenderEchoTest", new Logger("TEST"), LoggerLevel::getLevelError(), "testmessage");
     $eventDebug = new LoggerLoggingEvent("LoggerAppenderEchoTest", new Logger("TEST"), LoggerLevel::getLevelDebug(), "testmessage");
     $eventWarn = new LoggerLoggingEvent("LoggerAppenderEchoTest", new Logger("TEST"), LoggerLevel::getLevelWarn(), "testmessage");
     $result = $filter->decide($eventError);
     self::assertEquals($result, LoggerFilter::NEUTRAL);
     $result = $filter->decide($eventDebug);
     self::assertEquals($result, LoggerFilter::DENY);
     $result = $filter->decide($eventWarn);
     self::assertEquals($result, LoggerFilter::NEUTRAL);
 }
开发者ID:dobreapa,项目名称:owasp-esapi-php,代码行数:16,代码来源:LoggerFilterLevelRangeTest.php

示例10: testResetConfiguration

 public function testResetConfiguration()
 {
     $root = $this->hierarchy->getRootLogger();
     $appender = new LoggerAppenderConsole('A1');
     $root->addAppender($appender);
     $logger = $this->hierarchy->getLogger('test');
     self::assertEquals(1, count($this->hierarchy->getCurrentLoggers()));
     $this->hierarchy->resetConfiguration();
     self::assertEquals(LoggerLevel::getLevelDebug(), $root->getLevel());
     self::assertEquals(LoggerLevel::getLevelAll(), $this->hierarchy->getThreshold());
     self::assertEquals(1, count($this->hierarchy->getCurrentLoggers()));
     foreach ($this->hierarchy->getCurrentLoggers() as $logger) {
         self::assertNull($logger->getLevel());
         self::assertTrue($logger->getAdditivity());
         self::assertEquals(0, count($logger->getAllAppenders()), 0);
     }
 }
开发者ID:keehao,项目名称:Php-Object-Framework,代码行数:17,代码来源:LoggerHierarchyTest.php

示例11: testDefaultConfig

 /** Check default setup. */
 public function testDefaultConfig()
 {
     Logger::configure();
     $actual = Logger::getCurrentLoggers();
     $expected = array();
     $this->assertSame($expected, $actual);
     $appenders = Logger::getRootLogger()->getAllAppenders();
     $this->assertInternalType('array', $appenders);
     $this->assertEquals(count($appenders), 1);
     $names = array_keys($appenders);
     $this->assertSame('default', $names[0]);
     $appender = array_shift($appenders);
     $this->assertInstanceOf('LoggerAppenderEcho', $appender);
     $this->assertSame('default', $appender->getName());
     $layout = $appender->getLayout();
     $this->assertInstanceOf('LoggerLayoutTTCC', $layout);
     $root = Logger::getRootLogger();
     $appenders = $root->getAllAppenders();
     $this->assertInternalType('array', $appenders);
     $this->assertEquals(count($appenders), 1);
     $actual = $root->getLevel();
     $expected = LoggerLevel::getLevelDebug();
     $this->assertEquals($expected, $actual);
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:25,代码来源:LoggerConfiguratorTest.php

示例12: testDecideDeny

 public function testDecideDeny()
 {
     $filter = new LoggerFilterStringMatch();
     $filter->setAcceptOnMatch("false");
     $filter->setStringToMatch("testmessage");
     $eventError = new LoggerLoggingEvent("LoggerAppenderEchoTest", new Logger("TEST"), LoggerLevel::getLevelError(), "testmessage");
     $eventError2 = new LoggerLoggingEvent("LoggerAppenderEchoTest", new Logger("TEST"), LoggerLevel::getLevelError(), "xyz");
     $eventDebug = new LoggerLoggingEvent("LoggerAppenderEchoTest", new Logger("TEST"), LoggerLevel::getLevelError(), "testmessage");
     $eventDebug2 = new LoggerLoggingEvent("LoggerAppenderEchoTest", new Logger("TEST"), LoggerLevel::getLevelDebug(), "xyz");
     $eventWarn = new LoggerLoggingEvent("LoggerAppenderEchoTest", new Logger("TEST"), LoggerLevel::getLevelWarn(), "testmessage");
     $eventWarn2 = new LoggerLoggingEvent("LoggerAppenderEchoTest", new Logger("TEST"), LoggerLevel::getLevelWarn(), "xyz");
     $result = $filter->decide($eventError);
     self::assertEquals($result, LoggerFilter::DENY);
     $result = $filter->decide($eventError2);
     self::assertEquals($result, LoggerFilter::NEUTRAL);
     $result = $filter->decide($eventDebug);
     self::assertEquals($result, LoggerFilter::DENY);
     $result = $filter->decide($eventDebug2);
     self::assertEquals($result, LoggerFilter::NEUTRAL);
     $result = $filter->decide($eventWarn);
     self::assertEquals($result, LoggerFilter::DENY);
     $result = $filter->decide($eventWarn2);
     self::assertEquals($result, LoggerFilter::NEUTRAL);
 }
开发者ID:sacredwebsite,项目名称:scalr,代码行数:24,代码来源:LoggerFilterStringMatchTest.php

示例13: testLevelDebug

 public function testLevelDebug()
 {
     $this->doTestLevel(LoggerLevel::getLevelDebug(), LoggerLevel::DEBUG, 'DEBUG', 7);
     $this->doTestLevel(LoggerLevel::toLevel(LoggerLevel::DEBUG), LoggerLevel::DEBUG, 'DEBUG', 7);
     $this->doTestLevel(LoggerLevel::toLevel('DEBUG'), LoggerLevel::DEBUG, 'DEBUG', 7);
 }
开发者ID:sacredwebsite,项目名称:scalr,代码行数:6,代码来源:LoggerLevelTest.php

示例14: explode

 /**
  * This method must work for the root category as well.
  *
  * @param array $props array of properties
  * @param Logger &$logger
  * @param string $optionKey
  * @param string $loggerName
  * @param string $value
  * @return Logger
  */
 function &parseCategory($props, &$logger, $optionKey, $loggerName, $value)
 {
     LoggerLog::debug("LoggerPropertyConfigurator::parseCategory() " . "Parsing for [{$loggerName}] with value=[{$value}].");
     // We must skip over ',' but not white space
     $st = explode(',', $value);
     // If value is not in the form ", appender.." or "", then we should set
     // the level of the loggeregory.
     if (!(@$value[0] == ',' || empty($value))) {
         // just to be on the safe side...
         if (sizeof($st) == 0) {
             return;
         }
         $levelStr = current($st);
         LoggerLog::debug("LoggerPropertyConfigurator::parseCategory() " . "Level token is [{$levelStr}].");
         // If the level value is inherited, set category level value to
         // null. We also check that the user has not specified inherited for the
         // root category.
         if ('INHERITED' == strtoupper($levelStr) || 'NULL' == strtoupper($levelStr)) {
             if ($loggerName == LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_INTERNAL_ROOT_NAME) {
                 LoggerLog::warn("LoggerPropertyConfigurator::parseCategory() " . "The root logger cannot be set to null.");
             } else {
                 $logger->setLevel(null);
             }
         } else {
             $logger->setLevel(LoggerOptionConverter::toLevel($levelStr, LoggerLevel::getLevelDebug()));
         }
     }
     // Begin by removing all existing appenders.
     $logger->removeAllAppenders();
     while ($appenderName = next($st)) {
         $appenderName = trim($appenderName);
         if (empty($appenderName)) {
             continue;
         }
         LoggerLog::debug("LoggerPropertyConfigurator::parseCategory() " . "Parsing appender named [{$appenderName}].");
         $appender =& $this->parseAppender($props, $appenderName);
         if ($appender !== null) {
             $logger->addAppender($appender);
         }
     }
 }
开发者ID:ruckfull,项目名称:taobaocrm,代码行数:51,代码来源:LoggerPropertyConfigurator.php

示例15: getAllLevels

 /** Returns an array of all existing levels, sorted ascending by severity. */
 public static function getAllLevels()
 {
     return array(LoggerLevel::getLevelTrace(), LoggerLevel::getLevelDebug(), LoggerLevel::getLevelInfo(), LoggerLevel::getLevelWarn(), LoggerLevel::getLevelError(), LoggerLevel::getLevelFatal());
 }
开发者ID:HaakonME,项目名称:noark5-validator,代码行数:5,代码来源:LoggerTestHelper.php


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