Merge pull request #1083 from vibbow/develop

Update Logger to cache log handler.
This commit is contained in:
Lonnie Ezell 2018-07-07 23:06:44 -05:00 committed by GitHub
commit b269aa8204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -364,10 +364,14 @@ class Logger implements LoggerInterface
foreach ($this->handlerConfig as $className => $config)
{
if ( ! array_key_exists($className, $this->handlers)) {
$this->handlers[$className] = new $className($config);
}
/**
* @var \CodeIgniter\Log\Handlers\HandlerInterface
*/
$handler = new $className($config);
$handler = $this->handlers[$className];
if ( ! $handler->canHandle($level))
{