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