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