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 / README.md
matomo / app / vendor / prefixed / psr / log Last commit date
Psr 1 year ago LICENSE 2 years ago README.md 2 years ago
README.md
59 lines
1 PSR Log
2 =======
3
4 This repository holds all interfaces/classes/traits related to
5 [](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.mdPSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md](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 [](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.mdspecification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
58 for details.
59