-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStackLogger.php
More file actions
30 lines (26 loc) · 863 Bytes
/
Copy pathStackLogger.php
File metadata and controls
30 lines (26 loc) · 863 Bytes
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
<?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;
}