19 lines
312 B
PHP
19 lines
312 B
PHP
|
<?php
|
||
|
|
||
|
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;
|
||
|
}
|
||
|
}
|