1 | <?php |
||
14 | trait CanLog |
||
15 | { |
||
16 | /** |
||
17 | * System is unusable. |
||
18 | * |
||
19 | * @param string $message |
||
20 | * @param array $context |
||
21 | * |
||
22 | * @return void |
||
23 | */ |
||
24 | public function emergency($message, array $context = array()) |
||
30 | |||
31 | /** |
||
32 | * Action must be taken immediately. |
||
33 | * |
||
34 | * Example: Entire website down, database unavailable, etc. This should |
||
35 | * trigger the SMS alerts and wake you up. |
||
36 | * |
||
37 | * @param string $message |
||
38 | * @param array $context |
||
39 | * |
||
40 | * @return void |
||
41 | */ |
||
42 | public function alert($message, array $context = array()) |
||
48 | |||
49 | /** |
||
50 | * Critical conditions. |
||
51 | * |
||
52 | * Example: Application component unavailable, unexpected exception. |
||
53 | * |
||
54 | * @param string $message |
||
55 | * @param array $context |
||
56 | * |
||
57 | * @return void |
||
58 | */ |
||
59 | public function critical($message, array $context = array()) |
||
65 | |||
66 | /** |
||
67 | * Runtime errors that do not require immediate action but should typically |
||
68 | * be logged and monitored. |
||
69 | * |
||
70 | * @param string $message |
||
71 | * @param array $context |
||
72 | * |
||
73 | * @return void |
||
74 | */ |
||
75 | 6 | public function error($message, array $context = array()) |
|
81 | |||
82 | /** |
||
83 | * Exceptional occurrences that are not errors. |
||
84 | * |
||
85 | * Example: Use of deprecated APIs, poor use of an API, undesirable things |
||
86 | * that are not necessarily wrong. |
||
87 | * |
||
88 | * @param string $message |
||
89 | * @param array $context |
||
90 | * |
||
91 | * @return void |
||
92 | */ |
||
93 | public function warning($message, array $context = array()) |
||
99 | |||
100 | /** |
||
101 | * Normal but significant events. |
||
102 | * |
||
103 | * @param string $message |
||
104 | * @param array $context |
||
105 | * |
||
106 | * @return void |
||
107 | */ |
||
108 | public function notice($message, array $context = array()) |
||
114 | |||
115 | /** |
||
116 | * Interesting events. |
||
117 | * |
||
118 | * Example: User logs in, SQL logs. |
||
119 | * |
||
120 | * @param string $message |
||
121 | * @param array $context |
||
122 | * |
||
123 | * @return void |
||
124 | */ |
||
125 | 18 | public function info($message, array $context = array()) |
|
131 | |||
132 | /** |
||
133 | * Detailed debug information. |
||
134 | * |
||
135 | * @param string $message |
||
136 | * @param array $context |
||
137 | * |
||
138 | * @return void |
||
139 | */ |
||
140 | public function debug($message, array $context = array()) |
||
146 | |||
147 | /** |
||
148 | * Logs with an arbitrary level. |
||
149 | * |
||
150 | * @param mixed $level |
||
151 | * @param string $message |
||
152 | * @param array $context |
||
153 | * |
||
154 | * @return void |
||
155 | */ |
||
156 | public function log($level, $message, array $context = array()) |
||
162 | } |
||
163 |