mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-06 05:07:36 +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);
|
flock($this->stream, LOCK_EX);
|
||||||
}
|
}
|
||||||
|
|
||||||
fwrite($this->stream, (string) $record['formatted']);
|
$this->streamWrite($this->stream, $record);
|
||||||
|
|
||||||
if ($this->useLocking) {
|
if ($this->useLocking) {
|
||||||
flock($this->stream, LOCK_UN);
|
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)
|
private function customErrorHandler($code, $msg)
|
||||||
{
|
{
|
||||||
$this->errorMessage = preg_replace('{^(fopen|mkdir)\(.*?\): }', '', $msg);
|
$this->errorMessage = preg_replace('{^(fopen|mkdir)\(.*?\): }', '', $msg);
|
||||||
|
Reference in New Issue
Block a user