-
Notifications
You must be signed in to change notification settings - Fork 0
/
StackLogger.php
34 lines (28 loc) · 916 Bytes
/
StackLogger.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
declare(strict_types=1);
namespace TimDev\StackLogger;
use Psr\Log\LoggerInterface;
interface StackLogger extends LoggerInterface
{
/**
* Returns a new instance that has $context merged on top of any existing
* context.
*
* Useful when you're passing a logger up the call stack by passing or
* receiving the logger up or down the call stack.
*
* @param array<string, mixed> $context
*/
public function withContext(array $context = []): static;
/**
* Merge $context onto this instance's context.
*
* Useful in contexts like HTTP middleware, where you want to add
* some global context onto the logger, but aren't passing the a
* logger onwards as an argument.
*
* @param array<string, mixed> $context
*/
public function addContext(array $context): static;
public static function makeNullLogger(): self;
}