brilo-example/tests/Common/LoggerTrait.php

22 lines
342 B
PHP
Raw Permalink Normal View History

2024-07-29 16:50:58 +00:00
<?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;
}
}