MainLogger: write messages before calling logger attachments

This commit is contained in:
Dylan K. Taylor 2021-10-07 20:32:02 +01:00
parent 1be9b2f037
commit a555f21b18
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -244,12 +244,11 @@ class MainLogger extends \AttachableThreadedLogger implements \BufferedLogger{
$this->synchronized(function() use ($message, $level, $time) : void{
Terminal::writeLine($message);
$this->logWriterThread->write($time->format("Y-m-d") . " " . TextFormat::clean($message) . PHP_EOL);
foreach($this->attachments as $attachment){
$attachment->call($level, $message);
}
$this->logWriterThread->write($time->format("Y-m-d") . " " . TextFormat::clean($message) . PHP_EOL);
});
}