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


PHP LoggerLoggingEvent::getStartTime方法代码示例

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


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

示例1: testGetStartTime

 public function testGetStartTime()
 {
     $time = LoggerLoggingEvent::getStartTime();
     self::assertInternalType('float', $time);
     $time2 = LoggerLoggingEvent::getStartTime();
     self::assertEquals($time, $time2);
 }
开发者ID:keehao,项目名称:Php-Object-Framework,代码行数:7,代码来源:LoggerLoggingEventTest.php

示例2: testRelative

 public function testRelative()
 {
     $converter = new LoggerPatternConverterRelative($this->info);
     $expected = number_format($this->event->getTimeStamp() - $this->event->getStartTime(), 4);
     $actual = $converter->convert($this->event);
     self::assertSame($expected, $actual);
 }
开发者ID:brennantom,项目名称:hackazon,代码行数:7,代码来源:LoggerPatternConverterTest.php

示例3: convert

 /**
  * @param LoggerLoggingEvent $event
  * @return string
  */
 public function convert($event)
 {
     switch ($this->type) {
         case LoggerPatternParser::LOG4PHP_LOGGER_PATTERN_PARSER_RELATIVE_TIME_CONVERTER:
             $timeStamp = $event->getTimeStamp();
             $startTime = LoggerLoggingEvent::getStartTime();
             return (string) (int) ($timeStamp * 1000 - $startTime * 1000);
         case LoggerPatternParser::LOG4PHP_LOGGER_PATTERN_PARSER_THREAD_CONVERTER:
             return $event->getThreadName();
         case LoggerPatternParser::LOG4PHP_LOGGER_PATTERN_PARSER_LEVEL_CONVERTER:
             $level = $event->getLevel();
             return $level->toString();
         case LoggerPatternParser::LOG4PHP_LOGGER_PATTERN_PARSER_NDC_CONVERTER:
             return $event->getNDC();
         case LoggerPatternParser::LOG4PHP_LOGGER_PATTERN_PARSER_MESSAGE_CONVERTER:
             return $event->getRenderedMessage();
         default:
             return '';
     }
 }
开发者ID:AnvilStriker,项目名称:owasp-esapi-php,代码行数:24,代码来源:LoggerBasicPatternConverter.php

示例4: getTime

 /**
  * Returns the time in milliseconds passed from the beginning of execution
  * to the time the event was constructed.
  * 
  * @deprecated This method has been replaced by getRelativeTime which 
  * 		does not perform unneccesary multiplication and formatting.
  * 
  * @return integer 
  */
 public function getTime()
 {
     $eventTime = $this->getTimeStamp();
     $eventStartTime = LoggerLoggingEvent::getStartTime();
     return number_format(($eventTime - $eventStartTime) * 1000, 0, '', '');
 }
开发者ID:cdkisa,项目名称:majordomo,代码行数:15,代码来源:LoggerLoggingEvent.php

示例5: format

 /**
  * @param LoggerLoggingEvent $event
  * @return string
  */
 function format($event)
 {
     $sbuf = LOG4PHP_LINE_SEP . "<tr>" . LOG4PHP_LINE_SEP;
     $sbuf .= "<td>";
     $eventTime = (double) $event->getTimeStamp();
     $eventStartTime = (double) LoggerLoggingEvent::getStartTime();
     $sbuf .= number_format(($eventTime - $eventStartTime) * 1000, 0, '', '');
     $sbuf .= "</td>" . LOG4PHP_LINE_SEP;
     $sbuf .= "<td title=\"" . $event->getThreadName() . " thread\">";
     $sbuf .= $event->getThreadName();
     $sbuf .= "</td>" . LOG4PHP_LINE_SEP;
     $sbuf .= "<td title=\"Level\">";
     $level = $event->getLevel();
     if ($level->equals(LoggerLevel::getLevelDebug())) {
         $sbuf .= "<font color=\"#339933\">";
         $sbuf .= $level->toString();
         $sbuf .= "</font>";
     } elseif ($level->equals(LoggerLevel::getLevelWarn())) {
         $sbuf .= "<font color=\"#993300\"><strong>";
         $sbuf .= $level->toString();
         $sbuf .= "</strong></font>";
     } else {
         $sbuf .= $level->toString();
     }
     $sbuf .= "</td>" . LOG4PHP_LINE_SEP;
     $sbuf .= "<td title=\"" . htmlentities($event->getLoggerName(), ENT_QUOTES) . " category\">";
     $sbuf .= htmlentities($event->getLoggerName(), ENT_QUOTES);
     $sbuf .= "</td>" . LOG4PHP_LINE_SEP;
     if ($this->locationInfo) {
         $locInfo = $event->getLocationInformation();
         $sbuf .= "<td>";
         $sbuf .= htmlentities($locInfo->getFileName(), ENT_QUOTES) . ':' . $locInfo->getLineNumber();
         $sbuf .= "</td>" . LOG4PHP_LINE_SEP;
     }
     $sbuf .= "<td title=\"Message\">";
     $sbuf .= htmlentities($event->getRenderedMessage(), ENT_QUOTES);
     $sbuf .= "</td>" . LOG4PHP_LINE_SEP;
     $sbuf .= "</tr>" . LOG4PHP_LINE_SEP;
     if ($event->getNDC() != null) {
         $sbuf .= "<tr><td bgcolor=\"#EEEEEE\" style=\"font-size : xx-small;\" colspan=\"6\" title=\"Nested Diagnostic Context\">";
         $sbuf .= "NDC: " . htmlentities($event->getNDC(), ENT_QUOTES);
         $sbuf .= "</td></tr>" . LOG4PHP_LINE_SEP;
     }
     return $sbuf;
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:49,代码来源:LoggerLayoutHtml.php

示例6: getmypid

    {
        if ($this->threadName === null) {
            $this->threadName = (string) getmypid();
        }
        return $this->threadName;
    }
    /**
     * @return mixed null
     */
    function getThrowableInformation()
    {
        return null;
    }
    /**
     * Serialize this object
     * @return string
     */
    function toString()
    {
        serialize($this);
    }
    /**
     * Avoid serialization of the {@link $logger} object
     */
    function __sleep()
    {
        return array('fqcn', 'categoryName', 'level', 'ndc', 'ndcLookupRequired', 'message', 'renderedMessage', 'threadName', 'timestamp', 'locationInfo');
    }
}
LoggerLoggingEvent::getStartTime();
开发者ID:Bobsel,项目名称:gn-tic,代码行数:30,代码来源:LoggerLoggingEvent.php


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