Skip to content

Commit

Permalink
Fix #32 : Fixed logging not working with threads
Browse files Browse the repository at this point in the history
  • Loading branch information
khelle committed Sep 27, 2016
1 parent 9b96e0d commit 8b0d0b1
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/Log/LoggerWrapper.php
Expand Up @@ -2,7 +2,32 @@

namespace Kraken\Log;

use Monolog\Handler\HandlerInterface as MonologHandlerInterface;
use Monolog\Logger as Monolog;

class LoggerWrapper extends Monolog
{}
{
/**
* @param string $name The logging channel
* @param MonologHandlerInterface[] $handlers Optional stack of handlers, the first one in the array is called first, etc.
* @param callable[] $processors Optional array of processors
*/
public function __construct($name, array $handlers = [], array $processors = [])
{
/**
* This is a fix for Pthreads, since that extension does not copy static variables accross threads
*/
static::$levels = [
self::DEBUG => 'DEBUG',
self::INFO => 'INFO',
self::NOTICE => 'NOTICE',
self::WARNING => 'WARNING',
self::ERROR => 'ERROR',
self::CRITICAL => 'CRITICAL',
self::ALERT => 'ALERT',
self::EMERGENCY => 'EMERGENCY',
];

parent::__construct($name, $handlers, $processors);
}
}

0 comments on commit 8b0d0b1

Please sign in to comment.