1 | <?php |
||
12 | class LoggerRegistry |
||
13 | { |
||
14 | /** |
||
15 | * Returns the corresponding logger for the given channelName. |
||
16 | * |
||
17 | * @param string $channelName |
||
18 | * |
||
19 | * @return Logger |
||
20 | */ |
||
21 | 7 | public function getLogger(string $channelName): Logger |
|
25 | |||
26 | /** |
||
27 | * Registers a new log channel into Yii's DI container. |
||
28 | * The channel will be registered with an alias yii2-monolog.ChannelName. |
||
29 | * |
||
30 | * @param string $channelName |
||
31 | * @param callable $loggerCreationCallable The callable which should return the logger. |
||
32 | */ |
||
33 | 8 | public function registerLogChannel(string $channelName, callable $loggerCreationCallable) |
|
41 | |||
42 | /** |
||
43 | * Registers the logger to be used with the Psr LoggerInterface. |
||
44 | * |
||
45 | * @param callable $loggerCreationCallable |
||
46 | */ |
||
47 | public function registerPsrLogger(callable $loggerCreationCallable) |
||
53 | |||
54 | /** |
||
55 | * @param string $channelName |
||
56 | * |
||
57 | * @return string |
||
58 | */ |
||
59 | 8 | private function getLoggerAlias(string $channelName): string |
|
63 | } |
||
64 |