]> git.mxchange.org Git - friendica.git/blob - src/Util/Logger/VoidLogger.php
Fixes "PHP Warning: key() expects parameter 1 to be array, string given"
[friendica.git] / src / Util / Logger / VoidLogger.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2010-2021, the Friendica project
4  *
5  * @license GNU AGPL version 3 or any later version
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Affero General Public License for more details.
16  *
17  * You should have received a copy of the GNU Affero General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  *
20  */
21
22 namespace Friendica\Util\Logger;
23
24 use Psr\Log\LoggerInterface;
25
26 /**
27  * A Logger instance to not log
28  */
29 class VoidLogger implements LoggerInterface
30 {
31         /**
32          * System is unusable.
33          *
34          * @param string $message
35          * @param array $context
36          *
37          * @return void
38          */
39         public function emergency($message, array $context = array())
40         {
41                 return;
42         }
43
44         /**
45          * Action must be taken immediately.
46          *
47          * Example: Entire website down, database unavailable, etc. This should
48          * trigger the SMS alerts and wake you up.
49          *
50          * @param string $message
51          * @param array $context
52          *
53          * @return void
54          */
55         public function alert($message, array $context = array())
56         {
57                 return;
58         }
59
60         /**
61          * Critical conditions.
62          *
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())
71         {
72                 return;
73         }
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())
85         {
86                 return;
87         }
88
89         /**
90          * Exceptional occurrences that are not errors.
91          *
92          * Example: Use of deprecated APIs, poor use of an API, undesirable things
93          * that are not necessarily wrong.
94          *
95          * @param string $message
96          * @param array $context
97          *
98          * @return void
99          */
100         public function warning($message, array $context = array())
101         {
102                 return;
103         }
104
105         /**
106          * Normal but significant events.
107          *
108          * @param string $message
109          * @param array $context
110          *
111          * @return void
112          */
113         public function notice($message, array $context = array())
114         {
115                 return;
116         }
117
118         /**
119          * Interesting events.
120          *
121          * Example: User logs in, SQL logs.
122          *
123          * @param string $message
124          * @param array $context
125          *
126          * @return void
127          */
128         public function info($message, array $context = array())
129         {
130                 return;
131         }
132
133         /**
134          * Detailed debug information.
135          *
136          * @param string $message
137          * @param array $context
138          *
139          * @return void
140          */
141         public function debug($message, array $context = array())
142         {
143                 return;
144         }
145
146         /**
147          * Logs with an arbitrary level.
148          *
149          * @param mixed $level
150          * @param string $message
151          * @param array $context
152          *
153          * @return void
154          */
155         public function log($level, $message, array $context = array())
156         {
157                 return;
158         }
159 }