本文整理汇总了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);
}
}
}
示例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();
}
示例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;
});
}
示例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');
}
示例5: popProcessor
/**
* Removes the processor on top of the stack and returns it.
*
* @return callable
* @static
*/
public static function popProcessor()
{
return \Monolog\Logger::popProcessor();
}
示例6: popProcessor
/**
* Removes the processor on top of the stack and returns it.
*
* @return callable
*/
public function popProcessor()
{
return $this->monolog->popProcessor();
}
示例7: popProcessor
/**
* @return callable
*/
public function popProcessor()
{
return parent::popProcessor();
}