channel = trim($channel); $this->timestampFormat = $timestampFormat; } /** * Logs with an arbitrary level. * * @param mixed $level * @param string $message * @param mixed[] $context */ public function log($level, $message, array $context = []) : void { $prefix = ''; if ($this->timestampFormat) { $prefix .= '[' . date($this->timestampFormat) . '] '; } if ($this->channel) { $prefix .= $this->channel . '.'; } $prefix .= strtoupper((string) $level); echo $prefix . ': ' . trim($message) . PHP_EOL; } }