mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 12:47:39 +02:00
isolate fwrite to allow override
This commit is contained in:
committed by
Jordi Boggiano
parent
2133e01288
commit
09a68c81e3
@@ -113,13 +113,23 @@ class StreamHandler extends AbstractProcessingHandler
|
||||
flock($this->stream, LOCK_EX);
|
||||
}
|
||||
|
||||
fwrite($this->stream, (string) $record['formatted']);
|
||||
$this->streamWrite($this->stream, $record);
|
||||
|
||||
if ($this->useLocking) {
|
||||
flock($this->stream, LOCK_UN);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Write to stream
|
||||
* @param resource $stream
|
||||
* @param array $record
|
||||
*/
|
||||
protected function streamWrite($stream, array $record)
|
||||
{
|
||||
fwrite($stream, (string)$record['formatted']);
|
||||
}
|
||||
|
||||
private function customErrorHandler($code, $msg)
|
||||
{
|
||||
$this->errorMessage = preg_replace('{^(fopen|mkdir)\(.*?\): }', '', $msg);
|
||||
|
Reference in New Issue
Block a user