PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / trunk
Matomo Analytics – Powerful, Privacy-First Insights for WordPress vtrunk
5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / vendor / prefixed / psr / log / Psr / Log / LoggerTrait.php
matomo / app / vendor / prefixed / psr / log / Psr / Log Last commit date
Test 1 year ago AbstractLogger.php 2 years ago InvalidArgumentException.php 2 years ago LogLevel.php 2 years ago LoggerAwareInterface.php 2 years ago LoggerAwareTrait.php 2 years ago LoggerInterface.php 2 years ago LoggerTrait.php 2 years ago NullLogger.php 2 years ago
LoggerTrait.php
135 lines
1 <?php
2
3 namespace Matomo\Dependencies\Psr\Log;
4
5 /**
6 * This is a simple Logger trait that classes unable to extend AbstractLogger
7 * (because they extend another class, etc) can include.
8 *
9 * It simply delegates all log-level-specific methods to the `log` method to
10 * reduce boilerplate code that a simple Logger that does the same thing with
11 * messages regardless of the error level has to implement.
12 */
13 trait LoggerTrait
14 {
15 /**
16 * System is unusable.
17 *
18 * @param string $message
19 * @param array $context
20 *
21 * @return void
22 */
23 public function emergency($message, array $context = array())
24 {
25 $this->log(LogLevel::EMERGENCY, $message, $context);
26 }
27 /**
28 * Action must be taken immediately.
29 *
30 * Example: Entire website down, database unavailable, etc. This should
31 * trigger the SMS alerts and wake you up.
32 *
33 * @param string $message
34 * @param array $context
35 *
36 * @return void
37 */
38 public function alert($message, array $context = array())
39 {
40 $this->log(LogLevel::ALERT, $message, $context);
41 }
42 /**
43 * Critical conditions.
44 *
45 * Example: Application component unavailable, unexpected exception.
46 *
47 * @param string $message
48 * @param array $context
49 *
50 * @return void
51 */
52 public function critical($message, array $context = array())
53 {
54 $this->log(LogLevel::CRITICAL, $message, $context);
55 }
56 /**
57 * Runtime errors that do not require immediate action but should typically
58 * be logged and monitored.
59 *
60 * @param string $message
61 * @param array $context
62 *
63 * @return void
64 */
65 public function error($message, array $context = array())
66 {
67 $this->log(LogLevel::ERROR, $message, $context);
68 }
69 /**
70 * Exceptional occurrences that are not errors.
71 *
72 * Example: Use of deprecated APIs, poor use of an API, undesirable things
73 * that are not necessarily wrong.
74 *
75 * @param string $message
76 * @param array $context
77 *
78 * @return void
79 */
80 public function warning($message, array $context = array())
81 {
82 $this->log(LogLevel::WARNING, $message, $context);
83 }
84 /**
85 * Normal but significant events.
86 *
87 * @param string $message
88 * @param array $context
89 *
90 * @return void
91 */
92 public function notice($message, array $context = array())
93 {
94 $this->log(LogLevel::NOTICE, $message, $context);
95 }
96 /**
97 * Interesting events.
98 *
99 * Example: User logs in, SQL logs.
100 *
101 * @param string $message
102 * @param array $context
103 *
104 * @return void
105 */
106 public function info($message, array $context = array())
107 {
108 $this->log(LogLevel::INFO, $message, $context);
109 }
110 /**
111 * Detailed debug information.
112 *
113 * @param string $message
114 * @param array $context
115 *
116 * @return void
117 */
118 public function debug($message, array $context = array())
119 {
120 $this->log(LogLevel::DEBUG, $message, $context);
121 }
122 /**
123 * Logs with an arbitrary level.
124 *
125 * @param mixed $level
126 * @param string $message
127 * @param array $context
128 *
129 * @return void
130 *
131 * @throws \Psr\Log\InvalidArgumentException
132 */
133 public abstract function log($level, $message, array $context = array());
134 }
135