mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-08 06:06:40 +02:00
Fixes based on comments.
- Change function to private. - Use private variable correctly.
This commit is contained in:
@@ -61,7 +61,7 @@ class StreamHandler extends AbstractProcessingHandler
|
|||||||
if (!$this->url) {
|
if (!$this->url) {
|
||||||
throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().');
|
throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().');
|
||||||
}
|
}
|
||||||
$errorMessage = null;
|
$this->errorMessage = null;
|
||||||
set_error_handler(array($this, 'customErrorHandler'));
|
set_error_handler(array($this, 'customErrorHandler'));
|
||||||
$this->stream = fopen($this->url, 'a');
|
$this->stream = fopen($this->url, 'a');
|
||||||
restore_error_handler();
|
restore_error_handler();
|
||||||
@@ -73,7 +73,7 @@ class StreamHandler extends AbstractProcessingHandler
|
|||||||
fwrite($this->stream, (string) $record['formatted']);
|
fwrite($this->stream, (string) $record['formatted']);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function customErrorHandler($code, $msg) {
|
private function customErrorHandler($code, $msg) {
|
||||||
$this->errorMessage = preg_replace('{^fopen\(.*?\): }', '', $msg);
|
$this->errorMessage = preg_replace('{^fopen\(.*?\): }', '', $msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user