diff options
Diffstat (limited to 'vendor/psr/log')
-rw-r--r-- | vendor/psr/log/LICENSE | 19 | ||||
-rw-r--r-- | vendor/psr/log/README.md | 58 | ||||
-rw-r--r-- | vendor/psr/log/composer.json | 26 | ||||
-rw-r--r-- | vendor/psr/log/src/AbstractLogger.php | 15 | ||||
-rw-r--r-- | vendor/psr/log/src/InvalidArgumentException.php | 7 | ||||
-rw-r--r-- | vendor/psr/log/src/LogLevel.php | 18 | ||||
-rw-r--r-- | vendor/psr/log/src/LoggerAwareInterface.php | 18 | ||||
-rw-r--r-- | vendor/psr/log/src/LoggerAwareTrait.php | 26 | ||||
-rw-r--r-- | vendor/psr/log/src/LoggerInterface.php | 125 | ||||
-rw-r--r-- | vendor/psr/log/src/LoggerTrait.php | 142 | ||||
-rw-r--r-- | vendor/psr/log/src/NullLogger.php | 30 |
11 files changed, 484 insertions, 0 deletions
diff --git a/vendor/psr/log/LICENSE b/vendor/psr/log/LICENSE new file mode 100644 index 0000000..474c952 --- /dev/null +++ b/vendor/psr/log/LICENSE | |||
@@ -0,0 +1,19 @@ | |||
1 | Copyright (c) 2012 PHP Framework Interoperability Group | ||
2 | |||
3 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
4 | of this software and associated documentation files (the "Software"), to deal | ||
5 | in the Software without restriction, including without limitation the rights | ||
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
7 | copies of the Software, and to permit persons to whom the Software is | ||
8 | furnished to do so, subject to the following conditions: | ||
9 | |||
10 | The above copyright notice and this permission notice shall be included in | ||
11 | all copies or substantial portions of the Software. | ||
12 | |||
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
19 | THE SOFTWARE. | ||
diff --git a/vendor/psr/log/README.md b/vendor/psr/log/README.md new file mode 100644 index 0000000..a9f20c4 --- /dev/null +++ b/vendor/psr/log/README.md | |||
@@ -0,0 +1,58 @@ | |||
1 | PSR Log | ||
2 | ======= | ||
3 | |||
4 | This repository holds all interfaces/classes/traits related to | ||
5 | [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md). | ||
6 | |||
7 | Note that this is not a logger of its own. It is merely an interface that | ||
8 | describes a logger. See the specification for more details. | ||
9 | |||
10 | Installation | ||
11 | ------------ | ||
12 | |||
13 | ```bash | ||
14 | composer require psr/log | ||
15 | ``` | ||
16 | |||
17 | Usage | ||
18 | ----- | ||
19 | |||
20 | If you need a logger, you can use the interface like this: | ||
21 | |||
22 | ```php | ||
23 | <?php | ||
24 | |||
25 | use Psr\Log\LoggerInterface; | ||
26 | |||
27 | class Foo | ||
28 | { | ||
29 | private $logger; | ||
30 | |||
31 | public function __construct(LoggerInterface $logger = null) | ||
32 | { | ||
33 | $this->logger = $logger; | ||
34 | } | ||
35 | |||
36 | public function doSomething() | ||
37 | { | ||
38 | if ($this->logger) { | ||
39 | $this->logger->info('Doing work'); | ||
40 | } | ||
41 | |||
42 | try { | ||
43 | $this->doSomethingElse(); | ||
44 | } catch (Exception $exception) { | ||
45 | $this->logger->error('Oh no!', array('exception' => $exception)); | ||
46 | } | ||
47 | |||
48 | // do something useful | ||
49 | } | ||
50 | } | ||
51 | ``` | ||
52 | |||
53 | You can then pick one of the implementations of the interface to get a logger. | ||
54 | |||
55 | If you want to implement the interface, you can require this package and | ||
56 | implement `Psr\Log\LoggerInterface` in your code. Please read the | ||
57 | [specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) | ||
58 | for details. | ||
diff --git a/vendor/psr/log/composer.json b/vendor/psr/log/composer.json new file mode 100644 index 0000000..879fc6f --- /dev/null +++ b/vendor/psr/log/composer.json | |||
@@ -0,0 +1,26 @@ | |||
1 | { | ||
2 | "name": "psr/log", | ||
3 | "description": "Common interface for logging libraries", | ||
4 | "keywords": ["psr", "psr-3", "log"], | ||
5 | "homepage": "https://github.com/php-fig/log", | ||
6 | "license": "MIT", | ||
7 | "authors": [ | ||
8 | { | ||
9 | "name": "PHP-FIG", | ||
10 | "homepage": "https://www.php-fig.org/" | ||
11 | } | ||
12 | ], | ||
13 | "require": { | ||
14 | "php": ">=8.0.0" | ||
15 | }, | ||
16 | "autoload": { | ||
17 | "psr-4": { | ||
18 | "Psr\\Log\\": "src" | ||
19 | } | ||
20 | }, | ||
21 | "extra": { | ||
22 | "branch-alias": { | ||
23 | "dev-master": "3.x-dev" | ||
24 | } | ||
25 | } | ||
26 | } | ||
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 | |||
3 | namespace 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 | */ | ||
12 | abstract 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 | |||
3 | namespace Psr\Log; | ||
4 | |||
5 | class 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 | |||
3 | namespace Psr\Log; | ||
4 | |||
5 | /** | ||
6 | * Describes log levels. | ||
7 | */ | ||
8 | class 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 | |||
3 | namespace Psr\Log; | ||
4 | |||
5 | /** | ||
6 | * Describes a logger-aware instance. | ||
7 | */ | ||
8 | interface 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 | |||
3 | namespace Psr\Log; | ||
4 | |||
5 | /** | ||
6 | * Basic Implementation of LoggerAwareInterface. | ||
7 | */ | ||
8 | trait 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 | |||
3 | namespace 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 | */ | ||
20 | interface 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 | |||
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 | * @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 | |||
3 | namespace 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 | */ | ||
13 | class 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 | } | ||