PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 27.8
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v27.8
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / vendor_prefixed / psr / log / Psr / Log / LoggerTrait.php

LoggerTrait.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 27.8, at vendor_prefixed/psr/log/Psr/Log/LoggerTrait.php

135 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace YoastSEO_Vendor\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(\YoastSEO_Vendor\Psr\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(\YoastSEO_Vendor\Psr\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(\YoastSEO_Vendor\Psr\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(\YoastSEO_Vendor\Psr\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(\YoastSEO_Vendor\Psr\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(\YoastSEO_Vendor\Psr\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(\YoastSEO_Vendor\Psr\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(\YoastSEO_Vendor\Psr\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