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