1 | <?php |
||
11 | class Logger extends AdapterAbstract implements LoggerInterface |
||
12 | { |
||
13 | const SEVERITY_EMERGENCY = 'emergency'; |
||
14 | const SEVERITY_ALERT = 'alert'; |
||
15 | const SEVERITY_CRITICAL = 'critical'; |
||
16 | const SEVERITY_ERROR = 'error'; |
||
17 | const SEVERITY_WARNING = 'warning'; |
||
18 | const SEVERITY_NOTICE = 'notice'; |
||
19 | const SEVERITY_INFO = 'info'; |
||
20 | const SEVERITY_DEBUG = 'debug'; |
||
21 | |||
22 | /** |
||
23 | * System is unusable. |
||
24 | * |
||
25 | * @param string $message |
||
26 | * @param array $context |
||
27 | * @return null |
||
28 | */ |
||
29 | 1 | public function emergency($message, array $context = array()) |
|
33 | |||
34 | /** |
||
35 | * Action must be taken immediately. |
||
36 | * |
||
37 | * Example: Entire website down, database unavailable, etc. This should |
||
38 | * trigger the SMS alerts and wake you up. |
||
39 | * |
||
40 | * @param string $message |
||
41 | * @param array $context |
||
42 | * @return null |
||
43 | */ |
||
44 | 1 | public function alert($message, array $context = array()) |
|
49 | |||
50 | /** |
||
51 | * Critical conditions. |
||
52 | * |
||
53 | * Example: Application component unavailable, unexpected exception. |
||
54 | * |
||
55 | * @param string $message |
||
56 | * @param array $context |
||
57 | * @return null |
||
58 | */ |
||
59 | 1 | public function critical($message, array $context = array()) |
|
64 | |||
65 | /** |
||
66 | * Runtime errors that do not require immediate action but should typically |
||
67 | * be logged and monitored. |
||
68 | * |
||
69 | * @param string $message |
||
70 | * @param array $context |
||
71 | * @return null |
||
72 | */ |
||
73 | 1 | public function error($message, array $context = array()) |
|
78 | |||
79 | /** |
||
80 | * Exceptional occurrences that are not errors. |
||
81 | * |
||
82 | * Example: Use of deprecated APIs, poor use of an API, undesirable things |
||
83 | * that are not necessarily wrong. |
||
84 | * |
||
85 | * @param string $message |
||
86 | * @param array $context |
||
87 | * @return null |
||
88 | */ |
||
89 | 1 | public function warning($message, array $context = array()) |
|
94 | |||
95 | /** |
||
96 | * Normal but significant events. |
||
97 | * |
||
98 | * @param string $message |
||
99 | * @param array $context |
||
100 | * @return null |
||
101 | */ |
||
102 | 1 | public function notice($message, array $context = array()) |
|
107 | |||
108 | /** |
||
109 | * Interesting events. |
||
110 | * |
||
111 | * Example: User logs in, SQL logs. |
||
112 | * |
||
113 | * @param string $message |
||
114 | * @param array $context |
||
115 | * @return null |
||
116 | */ |
||
117 | 1 | public function info($message, array $context = array()) |
|
122 | |||
123 | /** |
||
124 | * Detailed debug information. |
||
125 | * |
||
126 | * @param string $message |
||
127 | * @param array $context |
||
128 | * @return null |
||
129 | */ |
||
130 | 1 | public function debug($message, array $context = array()) |
|
135 | |||
136 | /** |
||
137 | * Logs with an arbitrary level. |
||
138 | * |
||
139 | * @param string $level |
||
140 | * @param string $message |
||
141 | * @param array $context |
||
142 | * @return null |
||
143 | */ |
||
144 | 8 | public function log($level, $message, array $context = array()) |
|
150 | } |
||
151 |