LogDriver: move to subdirectory

This commit is contained in:
Zankaria 2025-07-26 23:42:10 +02:00
parent 3cb6fa3b5a
commit c5ce9a8030
6 changed files with 6 additions and 6 deletions

View file

@ -0,0 +1,27 @@
<?php
namespace Vichan\Data\Driver\Log;
defined('TINYBOARD') or exit;
/**
* Log to php's standard error file stream.
*/
class StderrLogDriver implements LogDriver {
use LogTrait;
private string $name;
private int $level;
public function __construct(string $name, int $level) {
$this->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");
}
}
}