1 | <?php |
||
11 | trait LoggedClassTrait |
||
12 | { |
||
13 | /** @var Logger */ |
||
14 | protected $logger; |
||
15 | |||
16 | /** |
||
17 | * Allows overriding the default file logger created at construction |
||
18 | * |
||
19 | * @param Logger $logger |
||
20 | */ |
||
21 | 1 | public function setLogger(Logger $logger) |
|
25 | |||
26 | /** |
||
27 | * Gets the Logger set for the Autoloader |
||
28 | * |
||
29 | * @return Logger |
||
30 | */ |
||
31 | 1 | public function getLogger() |
|
35 | |||
36 | /** |
||
37 | * If it exists, logs the message at the supplied level using the set Logger |
||
38 | * |
||
39 | * @param string $level The log level for the message |
||
40 | * @param string $message The message to be logged |
||
41 | * |
||
42 | * @return bool Returns true if the message was logged |
||
43 | * returns false if the message was not logged |
||
44 | */ |
||
45 | 25 | protected function updateLog($level, $message, array $context = array()) |
|
57 | } |
||
58 |