1 | <?php declare(strict_types = 1); |
||
26 | class MonologBuilder implements LoggerBuilderInterface |
||
27 | { |
||
28 | /** |
||
29 | * Logger name string |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $loggerName = 'tmdb'; |
||
33 | |||
34 | /** |
||
35 | * Handler config |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $handlersConfig = [ |
||
39 | [ |
||
40 | 'class' => 'Monolog\Handler\StreamHandler', |
||
41 | 'params' => ['php://stdout', Logger::DEBUG], |
||
42 | ], |
||
43 | ]; |
||
44 | |||
45 | /** |
||
46 | * Constructor |
||
47 | * @param array $config |
||
48 | */ |
||
49 | 4 | public function __construct(array $config = []) |
|
55 | |||
56 | /** |
||
57 | * Get Logger |
||
58 | * This method MUST return a valid PSR3 logger |
||
59 | * @return \Psr\Log\LoggerInterface |
||
60 | */ |
||
61 | 1 | public function getLogger() : \Psr\Log\LoggerInterface |
|
72 | |||
73 | /** |
||
74 | * Create new handler |
||
75 | * @param string $class |
||
76 | * @param array $params |
||
77 | * @return \Monolog\Handler\HandlerInterface |
||
78 | */ |
||
79 | 2 | public function newHandler(string $class, array $params = []) : \Monolog\Handler\HandlerInterface |
|
89 | |||
90 | /** |
||
91 | * Get main class name |
||
92 | * This method MUST return the name of the main class |
||
93 | * @return string |
||
94 | */ |
||
95 | 1 | public function getMainClassName() : string |
|
99 | |||
100 | /** |
||
101 | * Get package name |
||
102 | * This method MUST return the name of the package name |
||
103 | * @return string |
||
104 | */ |
||
105 | 1 | public function getPackageName() : string |
|
109 | } |
||
110 |