1 | <?php |
||
18 | class PsrToLog4PhpAdapter implements LoggerInterface |
||
19 | { |
||
20 | /** @var Logger */ |
||
21 | private $log4PhpLogger; |
||
22 | |||
23 | /** |
||
24 | * PsrToLog4PhpAdapter constructor. |
||
25 | * |
||
26 | * @param Logger $log4PhpLogger |
||
27 | */ |
||
28 | public function __construct(Logger $log4PhpLogger) |
||
32 | |||
33 | /** |
||
34 | * System is unusable. |
||
35 | * |
||
36 | * @param string $message |
||
37 | * @param array $context |
||
38 | * |
||
39 | * @return void |
||
40 | */ |
||
41 | public function emergency($message, array $context = array()) |
||
45 | |||
46 | /** |
||
47 | * Action must be taken immediately. |
||
48 | * Example: Entire website down, database unavailable, etc. This should |
||
49 | * trigger the SMS alerts and wake you up. |
||
50 | * |
||
51 | * @param string $message |
||
52 | * @param array $context |
||
53 | * |
||
54 | * @return void |
||
55 | */ |
||
56 | public function alert($message, array $context = array()) |
||
60 | |||
61 | /** |
||
62 | * Critical conditions. |
||
63 | * Example: Application component unavailable, unexpected exception. |
||
64 | * |
||
65 | * @param string $message |
||
66 | * @param array $context |
||
67 | * |
||
68 | * @return void |
||
69 | */ |
||
70 | public function critical($message, array $context = array()) |
||
74 | |||
75 | /** |
||
76 | * Runtime errors that do not require immediate action but should typically |
||
77 | * be logged and monitored. |
||
78 | * |
||
79 | * @param string $message |
||
80 | * @param array $context |
||
81 | * |
||
82 | * @return void |
||
83 | */ |
||
84 | public function error($message, array $context = array()) |
||
88 | |||
89 | /** |
||
90 | * Exceptional occurrences that are not errors. |
||
91 | * Example: Use of deprecated APIs, poor use of an API, undesirable things |
||
92 | * that are not necessarily wrong. |
||
93 | * |
||
94 | * @param string $message |
||
95 | * @param array $context |
||
96 | * |
||
97 | * @return void |
||
98 | */ |
||
99 | public function warning($message, array $context = array()) |
||
103 | |||
104 | /** |
||
105 | * Normal but significant events. |
||
106 | * |
||
107 | * @param string $message |
||
108 | * @param array $context |
||
109 | * |
||
110 | * @return void |
||
111 | */ |
||
112 | public function notice($message, array $context = array()) |
||
116 | |||
117 | /** |
||
118 | * Interesting events. |
||
119 | * Example: User logs in, SQL logs. |
||
120 | * |
||
121 | * @param string $message |
||
122 | * @param array $context |
||
123 | * |
||
124 | * @return void |
||
125 | */ |
||
126 | public function info($message, array $context = array()) |
||
130 | |||
131 | /** |
||
132 | * Detailed debug information. |
||
133 | * |
||
134 | * @param string $message |
||
135 | * @param array $context |
||
136 | * |
||
137 | * @return void |
||
138 | */ |
||
139 | public function debug($message, array $context = array()) |
||
143 | |||
144 | /** |
||
145 | * Logs with an arbitrary level. |
||
146 | * |
||
147 | * @param mixed $level |
||
148 | * @param string $message |
||
149 | * @param array $context |
||
150 | * |
||
151 | * @return void |
||
152 | */ |
||
153 | public function log($level, $message, array $context = array()) |
||
176 | } |