@@ -4,8 +4,8 @@ Wrap your PSR-3 logger with context accumulation and callable context elements.
4
4
5
5
## Inspiration
6
6
7
- Inspired by the [ similar functionality] in [ pinojs] . Design and implementation
8
- details differ, but the core idea remains:
7
+ Inspired by the [ similar functionality] in [ pinojs] . Design and implementation
8
+ details differ, but the core idea remains:
9
9
10
10
## Approach
11
11
@@ -15,7 +15,7 @@ additional `withContext` and `addContext` methods defined in this library's
15
15
[ StackLogger interface] ( src/StackLogger.php ) .
16
16
17
17
Also provided is [ ` MonologStackLogger ` ] ( src/MonologStackLogger.php ) , which
18
- decorates a ` Monolog\Logger ` and provides a working ` withName ` implementation.
18
+ decorates a ` Monolog\Logger ` and provides a working [ ` withName ` ] implementation.
19
19
20
20
## Usage
21
21
@@ -46,7 +46,7 @@ $mainLogger->info("Still here, with no accumulated context!");
46
46
// => [2020-10-17 17:40:53] app.INFO: Still here, with no accumulated context!
47
47
```
48
48
49
- This can be useful in any situation where want to carry some context through
49
+ This can be useful in any situation where want to carry some context through
50
50
successive calls.
51
51
52
52
``` php
@@ -78,9 +78,9 @@ function complexProcessing(User $user, \TimDev\StackLogger\StackLogger $logger){
78
78
79
79
### Dynamic (Callable) Context
80
80
81
- The other feature provided here is callable context. Any context elements that
82
- are ` callable ` will be invoked at logging-time, and the result of the
83
- computation will be logged. Callables take a single array argument:
81
+ The other feature provided here is callable context. Any context elements that
82
+ are ` callable ` will be invoked at logging-time, and the result of the
83
+ computation will be logged. Callables take a single array argument:
84
84
` function(array $context): mixed `
85
85
86
86
``` php
@@ -120,15 +120,11 @@ class SomeService
120
120
121
121
## To Do
122
122
123
- - [ ] Make MonologStackLogger implement Monolog's ResettableInterface?
124
- - [ ] Consider how this might play with Laravel, the insanely popular PHP
123
+ - [ ] Make MonologStackLogger implement Monolog's ResettableInterface?
124
+ - [ ] Consider how this might play with Laravel, the insanely popular PHP
125
125
framework that I do my best to avoid. 😜
126
126
127
-
128
-
129
127
[ similar functionality ] : https://getpino.io/#/docs/child-loggers
130
128
[ pinojs ] : https://github.com/pinojs/pino
131
129
[ PSR3 LoggerInterface ] : https://www.php-fig.org/psr/psr-3/
132
- [ monolog ] : https://github.com/Seldaek/monolog
133
- [ addRecord ] : https://github.com/Seldaek/monolog/blob/a54cd1f1782f62714e4d28651224316bb5540e08/src/Monolog/Logger.php#L278-L336
134
- [ withName ] : https://github.com/Seldaek/monolog/blob/a54cd1f1782f62714e4d28651224316bb5540e08/src/Monolog/Logger.php#L163-L172
130
+ [ `withName` ] : https://github.com/Seldaek/monolog/blob/a54cd1f1782f62714e4d28651224316bb5540e08/src/Monolog/Logger.php#L163-L172
0 commit comments