Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace Psr\Log;
|
Chris@0
|
4
|
Chris@0
|
5 /**
|
Chris@0
|
6 * Describes a logger instance.
|
Chris@0
|
7 *
|
Chris@0
|
8 * The message MUST be a string or object implementing __toString().
|
Chris@0
|
9 *
|
Chris@0
|
10 * The message MAY contain placeholders in the form: {foo} where foo
|
Chris@0
|
11 * will be replaced by the context data in key "foo".
|
Chris@0
|
12 *
|
Chris@0
|
13 * The context array can contain arbitrary data. The only assumption that
|
Chris@0
|
14 * can be made by implementors is that if an Exception instance is given
|
Chris@0
|
15 * to produce a stack trace, it MUST be in a key named "exception".
|
Chris@0
|
16 *
|
Chris@0
|
17 * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
|
Chris@0
|
18 * for the full interface specification.
|
Chris@0
|
19 */
|
Chris@0
|
20 interface LoggerInterface
|
Chris@0
|
21 {
|
Chris@0
|
22 /**
|
Chris@0
|
23 * System is unusable.
|
Chris@0
|
24 *
|
Chris@0
|
25 * @param string $message
|
Chris@0
|
26 * @param array $context
|
Chris@0
|
27 *
|
Chris@0
|
28 * @return void
|
Chris@0
|
29 */
|
Chris@0
|
30 public function emergency($message, array $context = array());
|
Chris@0
|
31
|
Chris@0
|
32 /**
|
Chris@0
|
33 * Action must be taken immediately.
|
Chris@0
|
34 *
|
Chris@0
|
35 * Example: Entire website down, database unavailable, etc. This should
|
Chris@0
|
36 * trigger the SMS alerts and wake you up.
|
Chris@0
|
37 *
|
Chris@0
|
38 * @param string $message
|
Chris@0
|
39 * @param array $context
|
Chris@0
|
40 *
|
Chris@0
|
41 * @return void
|
Chris@0
|
42 */
|
Chris@0
|
43 public function alert($message, array $context = array());
|
Chris@0
|
44
|
Chris@0
|
45 /**
|
Chris@0
|
46 * Critical conditions.
|
Chris@0
|
47 *
|
Chris@0
|
48 * Example: Application component unavailable, unexpected exception.
|
Chris@0
|
49 *
|
Chris@0
|
50 * @param string $message
|
Chris@0
|
51 * @param array $context
|
Chris@0
|
52 *
|
Chris@0
|
53 * @return void
|
Chris@0
|
54 */
|
Chris@0
|
55 public function critical($message, array $context = array());
|
Chris@0
|
56
|
Chris@0
|
57 /**
|
Chris@0
|
58 * Runtime errors that do not require immediate action but should typically
|
Chris@0
|
59 * be logged and monitored.
|
Chris@0
|
60 *
|
Chris@0
|
61 * @param string $message
|
Chris@0
|
62 * @param array $context
|
Chris@0
|
63 *
|
Chris@0
|
64 * @return void
|
Chris@0
|
65 */
|
Chris@0
|
66 public function error($message, array $context = array());
|
Chris@0
|
67
|
Chris@0
|
68 /**
|
Chris@0
|
69 * Exceptional occurrences that are not errors.
|
Chris@0
|
70 *
|
Chris@0
|
71 * Example: Use of deprecated APIs, poor use of an API, undesirable things
|
Chris@0
|
72 * that are not necessarily wrong.
|
Chris@0
|
73 *
|
Chris@0
|
74 * @param string $message
|
Chris@0
|
75 * @param array $context
|
Chris@0
|
76 *
|
Chris@0
|
77 * @return void
|
Chris@0
|
78 */
|
Chris@0
|
79 public function warning($message, array $context = array());
|
Chris@0
|
80
|
Chris@0
|
81 /**
|
Chris@0
|
82 * Normal but significant events.
|
Chris@0
|
83 *
|
Chris@0
|
84 * @param string $message
|
Chris@0
|
85 * @param array $context
|
Chris@0
|
86 *
|
Chris@0
|
87 * @return void
|
Chris@0
|
88 */
|
Chris@0
|
89 public function notice($message, array $context = array());
|
Chris@0
|
90
|
Chris@0
|
91 /**
|
Chris@0
|
92 * Interesting events.
|
Chris@0
|
93 *
|
Chris@0
|
94 * Example: User logs in, SQL logs.
|
Chris@0
|
95 *
|
Chris@0
|
96 * @param string $message
|
Chris@0
|
97 * @param array $context
|
Chris@0
|
98 *
|
Chris@0
|
99 * @return void
|
Chris@0
|
100 */
|
Chris@0
|
101 public function info($message, array $context = array());
|
Chris@0
|
102
|
Chris@0
|
103 /**
|
Chris@0
|
104 * Detailed debug information.
|
Chris@0
|
105 *
|
Chris@0
|
106 * @param string $message
|
Chris@0
|
107 * @param array $context
|
Chris@0
|
108 *
|
Chris@0
|
109 * @return void
|
Chris@0
|
110 */
|
Chris@0
|
111 public function debug($message, array $context = array());
|
Chris@0
|
112
|
Chris@0
|
113 /**
|
Chris@0
|
114 * Logs with an arbitrary level.
|
Chris@0
|
115 *
|
Chris@0
|
116 * @param mixed $level
|
Chris@0
|
117 * @param string $message
|
Chris@0
|
118 * @param array $context
|
Chris@0
|
119 *
|
Chris@0
|
120 * @return void
|
Chris@0
|
121 */
|
Chris@0
|
122 public function log($level, $message, array $context = array());
|
Chris@0
|
123 }
|