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


PHP Logger::popProcessor方法代码示例

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


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

示例1: work

 public function work()
 {
     $identity = $this->identify();
     $this->logger->notice(sprintf('%s waiting for work on queue(s) [%s]', $identity, join(', ', $this->queues)));
     for (;;) {
         $job = $this->metro->pop($this->queues, $this);
         if (null !== $job) {
             $jobHandler = $this->metro->createTaskLogHander($job->getId());
             $this->logger->pushHandler($jobHandler);
             $this->logger->pushProcessor(function ($record) use($job) {
                 $record['extra']['job_id'] = $job->getId();
                 return $record;
             });
             $this->workOn($job, $jobHandler);
             $this->logger->popHandler();
             $this->logger->popProcessor();
         }
         if ($this->interval <= 0) {
             return;
         }
         if (null === $job) {
             if ($this->drainMode) {
                 $this->logger->notice(sprintf('%s exiting because all queues are empty', $identity));
                 return;
             }
             usleep($this->interval * 1000.0);
         }
     }
 }
开发者ID:metro-q,项目名称:metro,代码行数:29,代码来源:Worker.php

示例2: testPushPopProcessor

 /**
  * @covers Monolog\Logger::pushProcessor
  * @covers Monolog\Logger::popProcessor
  * @expectedException LogicException
  */
 public function testPushPopProcessor()
 {
     $logger = new Logger(__METHOD__);
     $processor1 = new WebProcessor();
     $processor2 = new WebProcessor();
     $logger->pushProcessor($processor1);
     $logger->pushProcessor($processor2);
     $this->assertEquals($processor2, $logger->popProcessor());
     $this->assertEquals($processor1, $logger->popProcessor());
     $logger->popProcessor();
 }
开发者ID:nicolas-brousse,项目名称:lightMonitor,代码行数:16,代码来源:LoggerTest.php

示例3: resetLogger

 /**
  * @param Logger $logger
  */
 public function resetLogger(Logger $logger)
 {
     if (count($logger->getProcessors()) > 0) {
         $logger->popProcessor();
     }
     $logger->pushProcessor(function ($record) {
         $record['context']['ReqID'] = $this->getConfig()->req_id;
         return $record;
     });
 }
开发者ID:omerucel,项目名称:micro-sample-project,代码行数:13,代码来源:MonologHelper.php

示例4: assertDefaultProcessors

 public function assertDefaultProcessors(Logger $logger)
 {
     $processors = array();
     do {
         try {
             $processors[] = $processor = $logger->popProcessor();
         } catch (\Exception $e) {
         }
     } while (!isset($e));
     $this->assertInstanceOf('Graze\\Monolog\\Processor\\ExceptionMessageProcessor', array_shift($processors));
     $this->assertInstanceOf('Graze\\Monolog\\Processor\\EnvironmentProcessor', array_shift($processors));
     $this->assertInstanceOf('Graze\\Monolog\\Processor\\HttpProcessor', array_shift($processors));
     $this->assertSame(array(), $processors, 'There are more processors defined than should be');
 }
开发者ID:graze,项目名称:monolog-extensions,代码行数:14,代码来源:LoggerBuilderIntegrationTest.php

示例5: popProcessor

 /**
  * Removes the processor on top of the stack and returns it.
  *
  * @return callable 
  * @static 
  */
 public static function popProcessor()
 {
     return \Monolog\Logger::popProcessor();
 }
开发者ID:samcrosoft,项目名称:MicroTranslate,代码行数:10,代码来源:lumen_ide_helper.php

示例6: popProcessor

 /**
  * Removes the processor on top of the stack and returns it.
  *
  * @return callable
  */
 public function popProcessor()
 {
     return $this->monolog->popProcessor();
 }
开发者ID:projek-xyz,项目名称:slim-monolog,代码行数:9,代码来源:Monolog.php

示例7: popProcessor

 /**
  * @return callable
  */
 public function popProcessor()
 {
     return parent::popProcessor();
 }
开发者ID:akentner,项目名称:incoming-ftp,代码行数:7,代码来源:LoggerProxy.php


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