1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,52 +0,0 @@ |
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 |
-```bash |
|
13 |
-composer require psr/log |
|
14 |
-``` |
|
15 |
- |
|
16 |
-Usage |
|
17 |
- |
|
18 |
-If you need a logger, you can use the interface like this: |
|
19 |
- |
|
20 |
-```php |
|
21 |
-<?php |
|
22 |
- |
|
23 |
-use Psr\Log\LoggerInterface; |
|
24 |
- |
|
25 |
-class Foo |
|
26 |
-{ |
|
27 |
- private $logger; |
|
28 |
- |
|
29 |
- public function __construct(LoggerInterface $logger = null) |
|
30 |
- { |
|
31 |
- $this->logger = $logger; |
|
32 |
- } |
|
33 |
- |
|
34 |
- public function doSomething() |
|
35 |
- { |
|
36 |
- if ($this->logger) { |
|
37 |
- $this->logger->info('Doing work'); |
|
38 |
- } |
|
39 |
- |
|
40 |
- // do something useful |
|
41 |
- } |
|
42 |
-} |
|
43 |
-``` |
|
44 |
- |
|
45 |
-You can then pick one of the implementations of the interface to get a logger. |
|
46 |
- |
|
47 |
-If you want to implement the interface, you can require this package and |
|
48 |
-implement `Psr\Log\LoggerInterface` in your code. Please read the |
|
49 |
-[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) |
|
50 |
-for details. |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,52 @@ |
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 |
+ // do something useful |
|
43 |
+ } |
|
44 |
+} |
|
45 |
+``` |
|
46 |
+ |
|
47 |
+You can then pick one of the implementations of the interface to get a logger. |
|
48 |
+ |
|
49 |
+If you want to implement the interface, you can require this package and |
|
50 |
+implement `Psr\Log\LoggerInterface` in your code. Please read the |
|
51 |
+[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) |
|
52 |
+for details. |