summaryrefslogtreecommitdiff
path: root/vendor/psr/log/src
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/psr/log/src')
-rw-r--r--vendor/psr/log/src/AbstractLogger.php15
-rw-r--r--vendor/psr/log/src/InvalidArgumentException.php7
-rw-r--r--vendor/psr/log/src/LogLevel.php18
-rw-r--r--vendor/psr/log/src/LoggerAwareInterface.php18
-rw-r--r--vendor/psr/log/src/LoggerAwareTrait.php26
-rw-r--r--vendor/psr/log/src/LoggerInterface.php125
-rw-r--r--vendor/psr/log/src/LoggerTrait.php142
-rw-r--r--vendor/psr/log/src/NullLogger.php30
8 files changed, 381 insertions, 0 deletions
diff --git a/vendor/psr/log/src/AbstractLogger.php b/vendor/psr/log/src/AbstractLogger.php
new file mode 100644
index 0000000..d60a091
--- /dev/null
+++ b/vendor/psr/log/src/AbstractLogger.php
@@ -0,0 +1,15 @@
1<?php
2
3namespace Psr\Log;
4
5/**
6 * This is a simple Logger implementation that other Loggers can inherit from.
7 *
8 * It simply delegates all log-level-specific methods to the `log` method to
9 * reduce boilerplate code that a simple Logger that does the same thing with
10 * messages regardless of the error level has to implement.
11 */
12abstract class AbstractLogger implements LoggerInterface
13{
14 use LoggerTrait;
15}
diff --git a/vendor/psr/log/src/InvalidArgumentException.php b/vendor/psr/log/src/InvalidArgumentException.php
new file mode 100644
index 0000000..67f852d
--- /dev/null
+++ b/vendor/psr/log/src/InvalidArgumentException.php
@@ -0,0 +1,7 @@
1<?php
2
3namespace Psr\Log;
4
5class InvalidArgumentException extends \InvalidArgumentException
6{
7}
diff --git a/vendor/psr/log/src/LogLevel.php b/vendor/psr/log/src/LogLevel.php
new file mode 100644
index 0000000..9cebcac
--- /dev/null
+++ b/vendor/psr/log/src/LogLevel.php
@@ -0,0 +1,18 @@
1<?php
2
3namespace Psr\Log;
4
5/**
6 * Describes log levels.
7 */
8class LogLevel
9{
10 const EMERGENCY = 'emergency';
11 const ALERT = 'alert';
12 const CRITICAL = 'critical';
13 const ERROR = 'error';
14 const WARNING = 'warning';
15 const NOTICE = 'notice';
16 const INFO = 'info';
17 const DEBUG = 'debug';
18}
diff --git a/vendor/psr/log/src/LoggerAwareInterface.php b/vendor/psr/log/src/LoggerAwareInterface.php
new file mode 100644
index 0000000..cc46a95
--- /dev/null
+++ b/vendor/psr/log/src/LoggerAwareInterface.php
@@ -0,0 +1,18 @@
1<?php
2
3namespace Psr\Log;
4
5/**
6 * Describes a logger-aware instance.
7 */
8interface LoggerAwareInterface
9{
10 /**
11 * Sets a logger instance on the object.
12 *
13 * @param LoggerInterface $logger
14 *
15 * @return void
16 */
17 public function setLogger(LoggerInterface $logger): void;
18}
diff --git a/vendor/psr/log/src/LoggerAwareTrait.php b/vendor/psr/log/src/LoggerAwareTrait.php
new file mode 100644
index 0000000..4fb57a2
--- /dev/null
+++ b/vendor/psr/log/src/LoggerAwareTrait.php
@@ -0,0 +1,26 @@
1<?php
2
3namespace Psr\Log;
4
5/**
6 * Basic Implementation of LoggerAwareInterface.
7 */
8trait LoggerAwareTrait
9{
10 /**
11 * The logger instance.
12 *
13 * @var LoggerInterface|null
14 */
15 protected ?LoggerInterface $logger = null;
16
17 /**
18 * Sets a logger.
19 *
20 * @param LoggerInterface $logger
21 */
22 public function setLogger(LoggerInterface $logger): void
23 {
24 $this->logger = $logger;
25 }
26}
diff --git a/vendor/psr/log/src/LoggerInterface.php b/vendor/psr/log/src/LoggerInterface.php
new file mode 100644
index 0000000..b3a24b5
--- /dev/null
+++ b/vendor/psr/log/src/LoggerInterface.php
@@ -0,0 +1,125 @@
1<?php
2
3namespace Psr\Log;
4
5/**
6 * Describes a logger instance.
7 *
8 * The message MUST be a string or object implementing __toString().
9 *
10 * The message MAY contain placeholders in the form: {foo} where foo
11 * will be replaced by the context data in key "foo".
12 *
13 * The context array can contain arbitrary data. The only assumption that
14 * can be made by implementors is that if an Exception instance is given
15 * to produce a stack trace, it MUST be in a key named "exception".
16 *
17 * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
18 * for the full interface specification.
19 */
20interface LoggerInterface
21{
22 /**
23 * System is unusable.
24 *
25 * @param string|\Stringable $message
26 * @param mixed[] $context
27 *
28 * @return void
29 */
30 public function emergency(string|\Stringable $message, array $context = []): void;
31
32 /**
33 * Action must be taken immediately.
34 *
35 * Example: Entire website down, database unavailable, etc. This should
36 * trigger the SMS alerts and wake you up.
37 *
38 * @param string|\Stringable $message
39 * @param mixed[] $context
40 *
41 * @return void
42 */
43 public function alert(string|\Stringable $message, array $context = []): void;
44
45 /**
46 * Critical conditions.
47 *
48 * Example: Application component unavailable, unexpected exception.
49 *
50 * @param string|\Stringable $message
51 * @param mixed[] $context
52 *
53 * @return void
54 */
55 public function critical(string|\Stringable $message, array $context = []): void;
56
57 /**
58 * Runtime errors that do not require immediate action but should typically
59 * be logged and monitored.
60 *
61 * @param string|\Stringable $message
62 * @param mixed[] $context
63 *
64 * @return void
65 */
66 public function error(string|\Stringable $message, array $context = []): void;
67
68 /**
69 * Exceptional occurrences that are not errors.
70 *
71 * Example: Use of deprecated APIs, poor use of an API, undesirable things
72 * that are not necessarily wrong.
73 *
74 * @param string|\Stringable $message
75 * @param mixed[] $context
76 *
77 * @return void
78 */
79 public function warning(string|\Stringable $message, array $context = []): void;
80
81 /**
82 * Normal but significant events.
83 *
84 * @param string|\Stringable $message
85 * @param mixed[] $context
86 *
87 * @return void
88 */
89 public function notice(string|\Stringable $message, array $context = []): void;
90
91 /**
92 * Interesting events.
93 *
94 * Example: User logs in, SQL logs.
95 *
96 * @param string|\Stringable $message
97 * @param mixed[] $context
98 *
99 * @return void
100 */
101 public function info(string|\Stringable $message, array $context = []): void;
102
103 /**
104 * Detailed debug information.
105 *
106 * @param string|\Stringable $message
107 * @param mixed[] $context
108 *
109 * @return void
110 */
111 public function debug(string|\Stringable $message, array $context = []): void;
112
113 /**
114 * Logs with an arbitrary level.
115 *
116 * @param mixed $level
117 * @param string|\Stringable $message
118 * @param mixed[] $context
119 *
120 * @return void
121 *
122 * @throws \Psr\Log\InvalidArgumentException
123 */
124 public function log($level, string|\Stringable $message, array $context = []): void;
125}
diff --git a/vendor/psr/log/src/LoggerTrait.php b/vendor/psr/log/src/LoggerTrait.php
new file mode 100644
index 0000000..9c8733f
--- /dev/null
+++ b/vendor/psr/log/src/LoggerTrait.php
@@ -0,0 +1,142 @@
1<?php
2
3namespace 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 */
13trait LoggerTrait
14{
15 /**
16 * System is unusable.
17 *
18 * @param string|\Stringable $message
19 * @param array $context
20 *
21 * @return void
22 */
23 public function emergency(string|\Stringable $message, array $context = []): void
24 {
25 $this->log(LogLevel::EMERGENCY, $message, $context);
26 }
27
28 /**
29 * Action must be taken immediately.
30 *
31 * Example: Entire website down, database unavailable, etc. This should
32 * trigger the SMS alerts and wake you up.
33 *
34 * @param string|\Stringable $message
35 * @param array $context
36 *
37 * @return void
38 */
39 public function alert(string|\Stringable $message, array $context = []): void
40 {
41 $this->log(LogLevel::ALERT, $message, $context);
42 }
43
44 /**
45 * Critical conditions.
46 *
47 * Example: Application component unavailable, unexpected exception.
48 *
49 * @param string|\Stringable $message
50 * @param array $context
51 *
52 * @return void
53 */
54 public function critical(string|\Stringable $message, array $context = []): void
55 {
56 $this->log(LogLevel::CRITICAL, $message, $context);
57 }
58
59 /**
60 * Runtime errors that do not require immediate action but should typically
61 * be logged and monitored.
62 *
63 * @param string|\Stringable $message
64 * @param array $context
65 *
66 * @return void
67 */
68 public function error(string|\Stringable $message, array $context = []): void
69 {
70 $this->log(LogLevel::ERROR, $message, $context);
71 }
72
73 /**
74 * Exceptional occurrences that are not errors.
75 *
76 * Example: Use of deprecated APIs, poor use of an API, undesirable things
77 * that are not necessarily wrong.
78 *
79 * @param string|\Stringable $message
80 * @param array $context
81 *
82 * @return void
83 */
84 public function warning(string|\Stringable $message, array $context = []): void
85 {
86 $this->log(LogLevel::WARNING, $message, $context);
87 }
88
89 /**
90 * Normal but significant events.
91 *
92 * @param string|\Stringable $message
93 * @param array $context
94 *
95 * @return void
96 */
97 public function notice(string|\Stringable $message, array $context = []): void
98 {
99 $this->log(LogLevel::NOTICE, $message, $context);
100 }
101
102 /**
103 * Interesting events.
104 *
105 * Example: User logs in, SQL logs.
106 *
107 * @param string|\Stringable $message
108 * @param array $context
109 *
110 * @return void
111 */
112 public function info(string|\Stringable $message, array $context = []): void
113 {
114 $this->log(LogLevel::INFO, $message, $context);
115 }
116
117 /**
118 * Detailed debug information.
119 *
120 * @param string|\Stringable $message
121 * @param array $context
122 *
123 * @return void
124 */
125 public function debug(string|\Stringable $message, array $context = []): void
126 {
127 $this->log(LogLevel::DEBUG, $message, $context);
128 }
129
130 /**
131 * Logs with an arbitrary level.
132 *
133 * @param mixed $level
134 * @param string|\Stringable $message
135 * @param array $context
136 *
137 * @return void
138 *
139 * @throws \Psr\Log\InvalidArgumentException
140 */
141 abstract public function log($level, string|\Stringable $message, array $context = []): void;
142}
diff --git a/vendor/psr/log/src/NullLogger.php b/vendor/psr/log/src/NullLogger.php
new file mode 100644
index 0000000..c1cc3c0
--- /dev/null
+++ b/vendor/psr/log/src/NullLogger.php
@@ -0,0 +1,30 @@
1<?php
2
3namespace Psr\Log;
4
5/**
6 * This Logger can be used to avoid conditional log calls.
7 *
8 * Logging should always be optional, and if no logger is provided to your
9 * library creating a NullLogger instance to have something to throw logs at
10 * is a good way to avoid littering your code with `if ($this->logger) { }`
11 * blocks.
12 */
13class NullLogger extends AbstractLogger
14{
15 /**
16 * Logs with an arbitrary level.
17 *
18 * @param mixed $level
19 * @param string|\Stringable $message
20 * @param array $context
21 *
22 * @return void
23 *
24 * @throws \Psr\Log\InvalidArgumentException
25 */
26 public function log($level, string|\Stringable $message, array $context = []): void
27 {
28 // noop
29 }
30}