symfony_example_app/tests/Common/LoggerTrait.php

19 lines
312 B
PHP
Raw Normal View History

<?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;
}
}