1 | <?php |
||
25 | class Logger extends AbstractLogger implements LoggerInterface |
||
26 | { |
||
27 | |||
28 | private $handler; |
||
29 | private static $valid_levels = array( |
||
30 | "EMERGENCY", |
||
31 | "ALERT", |
||
32 | "CRITICAL", |
||
33 | "ERROR", |
||
34 | "WARNING", |
||
35 | "NOTICE", |
||
36 | "INFO", |
||
37 | "DEBUG" |
||
38 | ); |
||
39 | |||
40 | /** |
||
41 | * @param HandlerInterface $handler Sets the handler for logging (e.g. File handler). |
||
42 | */ |
||
43 | 3 | public function __construct(HandlerInterface $handler) |
|
47 | |||
48 | /** |
||
49 | * @return HandlerInterface |
||
50 | */ |
||
51 | 1 | public function getHandler() |
|
55 | |||
56 | /** |
||
57 | * Logs with an arbitrary level. |
||
58 | * |
||
59 | * @see http://www.php-fig.org/psr/psr-3/ |
||
60 | * |
||
61 | * @param mixed $level |
||
62 | * @param string $message |
||
63 | * @param array $context |
||
64 | * |
||
65 | * @return string Returns the text of the log entry. |
||
66 | */ |
||
67 | 16 | public function log($level, $message, array $context = array()) |
|
81 | } |
||
82 |