1 | <?php declare(strict_types=1); |
||
9 | abstract class AbstractLogglyLogger extends AbstractLogger |
||
10 | { |
||
11 | abstract protected function send(string $data); |
||
12 | |||
13 | /** |
||
14 | * Logging levels PSR-3 LogLevel enum |
||
15 | * |
||
16 | * @var array $levels Logging levels |
||
17 | */ |
||
18 | const LOG_LEVELS = [ |
||
19 | LogLevel::DEBUG => 'DEBUG', |
||
20 | LogLevel::INFO => 'INFO', |
||
21 | LogLevel::NOTICE => 'NOTICE', |
||
22 | LogLevel::WARNING => 'WARNING', |
||
23 | LogLevel::ERROR => 'ERROR', |
||
24 | LogLevel::CRITICAL => 'CRITICAL', |
||
25 | LogLevel::ALERT => 'ALERT', |
||
26 | LogLevel::EMERGENCY => 'EMERGENCY', |
||
27 | ]; |
||
28 | |||
29 | 26 | public function log($level, $message, array $context = []) |
|
41 | |||
42 | 24 | protected function format($level, $message, array $context): string |
|
60 | |||
61 | /** |
||
62 | * @param string $message |
||
63 | * @param array $context |
||
64 | * @return string |
||
65 | * |
||
66 | * Method copied from: https://github.com/Seldaek/monolog/blob/6e6586257d9fb231bf039563632e626cdef594e5/src/Monolog/Processor/PsrLogMessageProcessor.php |
||
67 | */ |
||
68 | 24 | private function processPlaceHolders(string $message, array $context): string |
|
81 | |||
82 | 18 | private function formatValue($value) |
|
94 | |||
95 | 24 | private function normalizeContext(array $context): array |
|
110 | } |
||
111 |