name = $name; $this->level = $level; } public function log(int $level, string $message): void { if ($level <= $this->level) { $lv = $this->levelToString($level); \fwrite(\STDERR, "{$this->name} $lv: $message\n"); } } }