Micro-PHP /
plugin-logger
| 1 | <?php |
||
| 2 | |||
| 3 | /* |
||
| 4 | * This file is part of the Micro framework package. |
||
| 5 | * |
||
| 6 | * (c) Stanislau Komar <[email protected]> |
||
| 7 | * |
||
| 8 | * For the full copyright and license information, please view the LICENSE |
||
| 9 | * file that was distributed with this source code. |
||
| 10 | */ |
||
| 11 | |||
| 12 | namespace Micro\Plugin\Logger\Facade; |
||
| 13 | |||
| 14 | use Micro\Plugin\Logger\Business\Provider\LoggerProviderInterface; |
||
| 15 | use Psr\Log\LoggerInterface; |
||
| 16 | |||
| 17 | readonly class LoggerFacade implements LoggerFacadeInterface |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 18 | { |
||
| 19 | 3 | public function __construct(private LoggerProviderInterface $loggerProvider) |
|
| 20 | { |
||
| 21 | 3 | } |
|
| 22 | |||
| 23 | 2 | public function getLogger(?string $loggerName = null): LoggerInterface |
|
| 24 | { |
||
| 25 | 2 | if (null === $loggerName) { |
|
| 26 | 1 | $loggerName = self::LOGGER_DEFAULT; |
|
| 27 | } |
||
| 28 | |||
| 29 | 2 | return $this->loggerProvider->getLogger($loggerName); |
|
| 30 | } |
||
| 31 | } |
||
| 32 |