當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。