| Conditions | 3 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 75 | public function send(string $scene, string $level, string $message, array $context) : void |
||
| 76 | { |
||
| 77 | $buf = ''; |
||
| 78 | |||
| 79 | $node = $this->env->app() . (($t = $this->env->tagged()) ? sprintf(':%s', $t) : ''); |
||
| 80 | $stream = $scene; |
||
| 81 | |||
| 82 | if (!isset($this->assets[$node][$stream])) { |
||
| 83 | $this->assets[$node][$stream] = true; |
||
| 84 | $buf .= sprintf("+node|%s|%s\r\n", $node, $stream); |
||
| 85 | } |
||
| 86 | |||
| 87 | $buf .= sprintf( |
||
| 88 | "+log|%s|%s|%s|%s\r\n", |
||
| 89 | $stream, |
||
| 90 | $node, |
||
| 91 | $level, |
||
| 92 | sprintf('%s > %s', $message, json_encode($context, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)) |
||
| 93 | ); |
||
| 94 | |||
| 95 | $this->pipe->write($buf); |
||
| 96 | } |
||
| 98 |