1 | <?php |
||
23 | class LogEntry implements LogEntryInterface |
||
24 | { |
||
25 | use LogLevelTrait; |
||
26 | use ProcessorAwareTrait; |
||
27 | |||
28 | /** |
||
29 | * message template |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $message = 'log message'; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $level = LogLevel::INFO; |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | */ |
||
43 | protected $context; |
||
44 | |||
45 | /** |
||
46 | * @param string $message |
||
47 | * @param array $context |
||
48 | */ |
||
49 | public function __construct(string $message = '', array $context = []) |
||
56 | |||
57 | /** |
||
58 | * {@inheritDoc} |
||
59 | */ |
||
60 | public function getMessage(): string |
||
64 | |||
65 | /** |
||
66 | * {@inheritDoc} |
||
67 | */ |
||
68 | public function setLevel(string $level) |
||
76 | |||
77 | /** |
||
78 | * {@inheritDoc} |
||
79 | */ |
||
80 | public function getLevel(): string |
||
84 | |||
85 | /** |
||
86 | * {@inheritDoc} |
||
87 | */ |
||
88 | public function setContext(array $context) |
||
93 | |||
94 | /** |
||
95 | * {@inheritDoc} |
||
96 | */ |
||
97 | public function getContext(): array |
||
101 | |||
102 | /** |
||
103 | * {@inheritDoc} |
||
104 | */ |
||
105 | public function __toString(): string |
||
110 | |||
111 | /** |
||
112 | * @param string $message message |
||
113 | * @param array $context |
||
114 | * @return string result |
||
115 | */ |
||
116 | protected function interpolate(string $message, array $context): string |
||
130 | } |