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


PHP LoggerLevel::getLevelTrace方法代码示例

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


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

示例1: 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

示例2: testTraceLayout

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

示例3: 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

示例4: isTraceEnabled

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

示例5: trace

 /**
  * Log a message object with the TRACE level.
  *
  * @param mixed $message message
  * @param Exception $throwable Optional throwable information to include 
  *   in the logging event.
  */
 public function trace($message, $throwable = null)
 {
     $this->log(LoggerLevel::getLevelTrace(), $message, $throwable);
 }
开发者ID:jquedena,项目名称:explora-titania,代码行数:11,代码来源:Logger.php

示例6: trace

 /**
  * Log a message object with the TRACE level.
  *
  * @param mixed $message message
  * @param mixed $caller caller object or caller string id
  */
 public function trace($message, $caller = null)
 {
     $this->log(LoggerLevel::getLevelTrace(), $message, $caller);
 }
开发者ID:haitao1880,项目名称:study,代码行数:10,代码来源:Logger.php

示例7: testLevelTrace

 public function testLevelTrace()
 {
     $this->doTestLevel(LoggerLevel::getLevelTrace(), LoggerLevel::TRACE, 'TRACE', LOG_DEBUG);
     $this->doTestLevel(LoggerLevel::toLevel(LoggerLevel::TRACE), LoggerLevel::TRACE, 'TRACE', LOG_DEBUG);
     $this->doTestLevel(LoggerLevel::toLevel('TRACE'), LoggerLevel::TRACE, 'TRACE', LOG_DEBUG);
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:6,代码来源:LoggerLevelTest.php

示例8: 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

示例9: isMemoryLimitReached

 /**
  *
  * @param type $threshold
  */
 public static function isMemoryLimitReached($threshold = 0.95)
 {
     $memory_limit = self::convertToBytes(ini_get('memory_limit'));
     $memUsage = memory_get_usage(true);
     if ($memUsage >= $memory_limit * $threshold) {
         if (self::$logger->isEnabledFor(LoggerLevel::getLevelTrace())) {
             self::$logger->trace("memUsage " . Tools::bytesToSize1024($memUsage) . ' >= ' . Tools::bytesToSize1024($memory_limit * $threshold));
         }
         return TRUE;
     }
     return FALSE;
 }
开发者ID:dfuzeau,项目名称:codev,代码行数:16,代码来源:tools.php

示例10: sql_query

 /**
  * Send a MySQL query
  * @param string $query  An SQL query
  * @return resource For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returns a resource on success, or false on error.
  * For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, returns true on success or false on error.
  */
 public function sql_query($query)
 {
     if (self::$logger->isDebugEnabled()) {
         $start = microtime(true);
     }
     $result = mysql_query($query, $this->link);
     $this->count++;
     if (self::$logger->isInfoEnabled()) {
         if (NULL == $this->countByQuery) {
             $this->countByQuery = array();
         }
         if (!array_key_exists($query, $this->countByQuery)) {
             $this->countByQuery[$query] = 1;
         } else {
             $this->countByQuery[$query] += 1;
         }
         if (self::$logger->isEnabledFor(LoggerLevel::getLevelTrace())) {
             self::$logger->trace("SQL Query #" . $this->count . " (" . round(microtime(true) - $start, 4) . " sec) : " . $query);
         }
     }
     if (!$result) {
         $userid = $_SESSION['userid'];
         $e = new Exception('user=' . $userid . ', SQL ALERT: ' . $this->sql_error() . ' : ' . $query);
         self::$logger->error('EXCEPTION: ' . $e->getMessage());
         self::$logger->error("EXCEPTION stack-trace:\n" . $e->getTraceAsString());
     }
     return $result;
 }
开发者ID:fg-ok,项目名称:codev,代码行数:34,代码来源:sqlwrapper.class.php

示例11: compare

 /**
  * uSort compare method
  *
  *
  * @param Comparable $activityA
  * @param Comparable $activityB
  *
  * @return '1' if $activityB > $activityA, -1 if $activityB is lower, 0 if equals
  */
 public static function compare(Comparable $activityA, Comparable $activityB)
 {
     // the oldest activity should be in front of the list
     if ($activityA->endTimestamp > $activityB->endTimestamp) {
         if (self::$logger->isEnabledFor(LoggerLevel::getLevelTrace())) {
             self::$logger->trace("activity.compareTo FALSE  (" . date('Y-m-d', $activityA->endTimestamp) . " > " . date('Y-m-d', $activityB->endTimestamp) . ")");
         }
         return 1;
     } else {
         if ($activityA->endTimestamp < $activityB->endTimestamp) {
             if (self::$logger->isEnabledFor(LoggerLevel::getLevelTrace())) {
                 self::$logger->trace("activity.compareTo   (" . date('Y-m-d', $activityA->endTimestamp) . " < " . date('Y-m-d', $activityB->endTimestamp) . ")");
             }
             return -1;
         }
     }
     return 0;
 }
开发者ID:fg-ok,项目名称:codev,代码行数:27,代码来源:gantt_manager.class.php

示例12: testPriorityOverride

 public function testPriorityOverride()
 {
     if (!method_exists('ReflectionProperty', 'setAccessible')) {
         $this->markTestSkipped("ReflectionProperty::setAccessible() required to perform this test (available in PHP 5.3.2+).");
     }
     $appender = new LoggerAppenderSyslog();
     $appender->setPriority('EMERG');
     $appender->setOverridePriority(true);
     $appender->activateOptions();
     $levels = array(LoggerLevel::getLevelTrace(), LoggerLevel::getLevelDebug(), LoggerLevel::getLevelInfo(), LoggerLevel::getLevelWarn(), LoggerLevel::getLevelError(), LoggerLevel::getLevelFatal());
     $expected = LOG_EMERG;
     $method = new ReflectionMethod('LoggerAppenderSyslog', 'getSyslogPriority');
     $method->setAccessible(true);
     foreach ($levels as $level) {
         $actual = $method->invoke($appender, $level);
         $this->assertSame($expected, $actual);
     }
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:18,代码来源:LoggerAppenderSyslogTest.php

示例13: getHoliday

 /**
  * Get holiday
  * @param int $timestamp
  * @return Holiday
  */
 private function getHoliday($timestamp)
 {
     foreach (self::$HolidayList as $h) {
         if ($h->timestamp == $timestamp) {
             if (self::$logger->isEnabledFor(LoggerLevel::getLevelTrace())) {
                 self::$logger->trace("Holiday found  " . date("d M Y", $h->timestamp) . "  - " . date("d M Y", $timestamp) . "  {$h->description}");
             }
             return $h;
         }
     }
     if (self::$logger->isEnabledFor(LoggerLevel::getLevelTrace())) {
         self::$logger->trace("No Holiday defined for on: " . date("d M Y", $timestamp) . "   {$timestamp}");
     }
     return NULL;
 }
开发者ID:fg-ok,项目名称:codev,代码行数:20,代码来源:holidays.class.php

示例14: __construct

 /**
  * Private constructor to respect the singleton pattern
  */
 private function __construct()
 {
     self::$configVariables = array();
     $query = "SELECT * FROM `codev_config_table`";
     $result = SqlWrapper::getInstance()->sql_query($query);
     if (!$result) {
         echo "<span style='color:red'>ERROR: Query FAILED</span>";
         exit;
     }
     while ($row = SqlWrapper::getInstance()->sql_fetch_object($result)) {
         if (self::$logger->isDebugEnabled()) {
             self::$logger->debug("id={$row->config_id}, val={$row->value}, type={$row->type}");
         }
         $key = $row->config_id . "_" . $row->user_id . $row->project_id . $row->team_id . $row->servicecontract_id . $row->commandset_id . $row->command_id;
         self::$configVariables[$key] = new ConfigItem($row->config_id, $row->value, $row->type);
     }
     if (self::$logger->isEnabledFor(LoggerLevel::getLevelTrace())) {
         self::$logger->trace("Config ready");
     }
 }
开发者ID:siebrand,项目名称:codev,代码行数:23,代码来源:config.class.php


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