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


PHP LoggerLoggingEvent::getMessage方法代码示例

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


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

示例1: append

 public function append(LoggerLoggingEvent $event)
 {
     $log = new StdClass();
     $log->time = $event->getTimeStamp();
     $log->level = $event->getLevel()->toString();
     $log->msg = $event->getMessage();
     $log->logger = $event->getLoggerName();
     $this->logBuffer[] = $log;
     $this->emitter->emit('event', array($log));
     if (count($this->logBuffer) > $this->logLimit) {
         array_shift($this->logBuffer);
     }
 }
开发者ID:unkerror,项目名称:Budabot,代码行数:13,代码来源:LoggerAppenderBuffer.php

示例2: append

 public function append(LoggerLoggingEvent $event)
 {
     $msg = $event->getMessage();
     // Skip formatting for objects and arrays which are handled by FirePHP.
     if (!is_array($msg) && !is_object($msg)) {
         $msg = $this->getLayout()->format($event);
     }
     switch ($event->getLevel()->toInt()) {
         case LoggerLevel::TRACE:
         case LoggerLevel::DEBUG:
             $this->console->log($msg);
             break;
         case LoggerLevel::INFO:
             $this->console->info($msg);
             break;
         case LoggerLevel::WARN:
             $this->console->warn($msg);
             break;
         case LoggerLevel::ERROR:
         case LoggerLevel::FATAL:
             $this->console->error($msg);
             break;
     }
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:24,代码来源:LoggerAppenderFirePHP.php

示例3: format

 /**
  * Converts the logging event into an array which can be logged to mongodb.
  * 
  * @param LoggerLoggingEvent $event
  * @return array The array representation of the logging event.
  */
 protected function format(LoggerLoggingEvent $event)
 {
     $timestampSec = (int) $event->getTimestamp();
     $timestampUsec = (int) (($event->getTimestamp() - $timestampSec) * 1000000);
     $document = array('timestamp' => new MongoDate($timestampSec, $timestampUsec), 'level' => $event->getLevel()->toString(), 'thread' => (int) $event->getThreadName(), 'message' => $event->getMessage(), 'loggerName' => $event->getLoggerName());
     $locationInfo = $event->getLocationInformation();
     if ($locationInfo != null) {
         $document['fileName'] = $locationInfo->getFileName();
         $document['method'] = $locationInfo->getMethodName();
         $document['lineNumber'] = $locationInfo->getLineNumber() == 'NA' ? 'NA' : (int) $locationInfo->getLineNumber();
         $document['className'] = $locationInfo->getClassName();
     }
     $throwableInfo = $event->getThrowableInformation();
     if ($throwableInfo != null) {
         $document['exception'] = $this->formatThrowable($throwableInfo->getThrowable());
     }
     return $document;
 }
开发者ID:alexandreannic,项目名称:android-holo-colors,代码行数:24,代码来源:LoggerAppenderMongoDB.php

示例4: getFullMessage

 protected function getFullMessage(LoggerLoggingEvent $event)
 {
     if (strpos($event->getMessage(), $this->getShortMessageEndTag()) !== false) {
         list(, $fullMessage) = explode($this->getShortMessageEndTag(), $event->getMessage());
         return $fullMessage;
     }
     return $event->getMessage();
 }
开发者ID:rurri,项目名称:log4php-graylog2,代码行数:8,代码来源:LoggerLayoutGelf.php

示例5: append

 public function append(\LoggerLoggingEvent $event)
 {
     self::addError(strtolower($event->getLevel()->toString()), $event->getMessage());
 }
开发者ID:diego3,项目名称:myframework-core,代码行数:4,代码来源:LoggerApp.php

示例6: doAppend

 /**
  * @see LoggerAppender::doAppend()
  * @param LoggerLoggingEvent $event
  */
 function doAppend($event)
 {
     LoggerLog::debug("LoggerAppenderSkeleton::doAppend() " . $event->getMessage());
     if ($this->closed) {
         LoggerLog::debug("LoggerAppenderSkeleton::doAppend() Attempted to append to closed appender named [{$this->name}].");
         return;
     }
     if (!$this->isAsSevereAsThreshold($event->getLevel())) {
         LoggerLog::debug("LoggerAppenderSkeleton::doAppend() event level is less severe than threshold.");
         return;
     }
     $f = $this->getFirstFilter();
     while ($f !== null) {
         switch ($f->decide($event)) {
             case LOG4PHP_LOGGER_FILTER_DENY:
                 return;
             case LOG4PHP_LOGGER_FILTER_ACCEPT:
                 return $this->append($event);
             case LOG4PHP_LOGGER_FILTER_NEUTRAL:
                 $f = $f->next;
         }
     }
     $this->append($event);
 }
开发者ID:Bobsel,项目名称:gn-tic,代码行数:28,代码来源:LoggerAppenderSkeleton.php


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