brilo-example/tests/Common/LoggerTrait.php

22 lines
342 B
PHP

<?php
declare(strict_types=1);
namespace App\Tests\Common;
use Monolog\Handler\TestHandler;
use Monolog\Logger;
trait LoggerTrait
{
/**
* @return Logger
*/
protected function getLogger(): Logger
{
$logger = new Logger('test');
$logger->pushHandler(new TestHandler());
return $logger;
}
}