|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Oliverde8\PhpEtlBundle\Model; |
|
4
|
|
|
|
|
5
|
|
|
use Psr\Log\LoggerInterface; |
|
6
|
|
|
|
|
7
|
|
|
class LoggerProxy implements LoggerInterface |
|
8
|
|
|
{ |
|
9
|
|
|
private LoggerInterface $logger; |
|
10
|
|
|
|
|
11
|
|
|
private ExecutionContext $executionContext; |
|
12
|
|
|
|
|
13
|
|
|
public function __construct(LoggerInterface $logger) |
|
14
|
|
|
{ |
|
15
|
|
|
$this->logger = $logger; |
|
16
|
|
|
} |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* @param ExecutionContext $executionContext |
|
20
|
|
|
*/ |
|
21
|
|
|
public function setExecutionContext(ExecutionContext $executionContext): void |
|
22
|
|
|
{ |
|
23
|
|
|
$this->executionContext = $executionContext; |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
public function emergency(string|\Stringable $message, array $context = array()): void |
|
27
|
|
|
{ |
|
28
|
|
|
$this->logger->emergency($message, $this->executionContext->getLoggerContext($context)); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
public function alert(string|\Stringable $message, array $context = array()): void |
|
32
|
|
|
{ |
|
33
|
|
|
$this->logger->alert($message, $this->executionContext->getLoggerContext($context)); |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
public function critical(string|\Stringable $message, array $context = array()): void |
|
37
|
|
|
{ |
|
38
|
|
|
$this->logger->critical($message, $this->executionContext->getLoggerContext($context)); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
public function error(string|\Stringable $message, array $context = array()): void |
|
42
|
|
|
{ |
|
43
|
|
|
$this->logger->error($message, $this->executionContext->getLoggerContext($context)); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
public function warning(string|\Stringable $message, array $context = array()): void |
|
47
|
|
|
{ |
|
48
|
|
|
$this->logger->warning($message, $this->executionContext->getLoggerContext($context)); |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
public function notice(string|\Stringable $message, array $context = array()): void |
|
52
|
|
|
{ |
|
53
|
|
|
$this->logger->notice($message, $this->executionContext->getLoggerContext($context)); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
public function info(string|\Stringable $message, array $context = array()): void |
|
57
|
|
|
{ |
|
58
|
|
|
$this->logger->info($message, $this->executionContext->getLoggerContext($context)); |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
public function debug(string|\Stringable $message, array $context = array()): void |
|
62
|
|
|
{ |
|
63
|
|
|
$this->logger->debug($message, $this->executionContext->getLoggerContext($context)); |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
public function log($level, string|\Stringable $message, array $context = array()): void |
|
67
|
|
|
{ |
|
68
|
|
|
$this->logger->log($level, $message, $this->executionContext->getLoggerContext($context)); |
|
69
|
|
|
} |
|
70
|
|
|
} |
|
71
|
|
|
|