| Conditions | 2 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
||
| 30 | { |
||
| 31 | $loggerConfig = $container->get('config')['logger']; |
||
| 32 | $isDebug = $container->get('config')['debug'] ?? false; |
||
| 33 | |||
| 34 | $formatter = new LineFormatter('[%datetime%] %channel%.%level_name% - %message% %context%' . PHP_EOL); |
||
| 35 | $formatter->includeStacktraces(); |
||
| 36 | |||
| 37 | $handler = new StreamHandler($loggerConfig['file'], $isDebug ? Logger::DEBUG : Logger::INFO); |
||
| 38 | $handler->setFormatter($formatter); |
||
| 39 | |||
| 40 | return new Logger('alejandrocelaya.com', [$handler]); |
||
| 41 | } |
||
| 42 | } |
||
| 43 |