PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.3
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.3
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / vendor / psr / log / src / LoggerTrait.php

LoggerTrait.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.13.3, at vendor/psr/log/src/LoggerTrait.php

99 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace 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 public function emergency(string|\Stringable $message, array $context = []): void
19 {
20 $this->log(LogLevel::EMERGENCY, $message, $context);
21 }
22
23 /**
24 * Action must be taken immediately.
25 *
26 * Example: Entire website down, database unavailable, etc. This should
27 * trigger the SMS alerts and wake you up.
28 */
29 public function alert(string|\Stringable $message, array $context = []): void
30 {
31 $this->log(LogLevel::ALERT, $message, $context);
32 }
33
34 /**
35 * Critical conditions.
36 *
37 * Example: Application component unavailable, unexpected exception.
38 */
39 public function critical(string|\Stringable $message, array $context = []): void
40 {
41 $this->log(LogLevel::CRITICAL, $message, $context);
42 }
43
44 /**
45 * Runtime errors that do not require immediate action but should typically
46 * be logged and monitored.
47 */
48 public function error(string|\Stringable $message, array $context = []): void
49 {
50 $this->log(LogLevel::ERROR, $message, $context);
51 }
52
53 /**
54 * Exceptional occurrences that are not errors.
55 *
56 * Example: Use of deprecated APIs, poor use of an API, undesirable things
57 * that are not necessarily wrong.
58 */
59 public function warning(string|\Stringable $message, array $context = []): void
60 {
61 $this->log(LogLevel::WARNING, $message, $context);
62 }
63
64 /**
65 * Normal but significant events.
66 */
67 public function notice(string|\Stringable $message, array $context = []): void
68 {
69 $this->log(LogLevel::NOTICE, $message, $context);
70 }
71
72 /**
73 * Interesting events.
74 *
75 * Example: User logs in, SQL logs.
76 */
77 public function info(string|\Stringable $message, array $context = []): void
78 {
79 $this->log(LogLevel::INFO, $message, $context);
80 }
81
82 /**
83 * Detailed debug information.
84 */
85 public function debug(string|\Stringable $message, array $context = []): void
86 {
87 $this->log(LogLevel::DEBUG, $message, $context);
88 }
89
90 /**
91 * Logs with an arbitrary level.
92 *
93 * @param mixed $level
94 *
95 * @throws \Psr\Log\InvalidArgumentException
96 */
97 abstract public function log($level, string|\Stringable $message, array $context = []): void;
98 }
99