1 | <?php |
||
15 | class StreamWriter implements WriterInterface { |
||
16 | |||
17 | /** |
||
18 | * @var resource The stream resource. |
||
19 | */ |
||
20 | protected $stream; |
||
21 | |||
22 | /** |
||
23 | * @var FormatterInterface[] An array of formatters. |
||
24 | */ |
||
25 | protected $formatters = []; |
||
26 | |||
27 | /** |
||
28 | * StreamWriter constructor. |
||
29 | * |
||
30 | * @param string $stream The stream to write to. |
||
31 | */ |
||
32 | 2 | public function __construct(string $stream) { |
|
35 | |||
36 | /** |
||
37 | * Add a formatter to be used by the writer. |
||
38 | * |
||
39 | * @param FormatterInterface $formatter A formatter to use for the writer. |
||
40 | * |
||
41 | * @return $this |
||
42 | */ |
||
43 | public function addFormatter(FormatterInterface $formatter) { |
||
48 | |||
49 | /** |
||
50 | * Write the stream. |
||
51 | * |
||
52 | * @param int $timestamp The unix timestamp of the log. |
||
53 | * @param string $logLevel The level of the message (e.g. INFO, SUCCESS, WARNING, ERROR). |
||
54 | * @param string $message The message. |
||
55 | * @param int $indentLevel The nesting level of the message. |
||
56 | * @param float|null $duration The duration to add to the message. |
||
57 | */ |
||
58 | public function write(int $timestamp, string $logLevel, string $message, int $indentLevel = 0, $duration = null) { |
||
75 | } |
||
76 |