Handle prematurely closed streams in StreamLogger.

This commit is contained in:
Justin Hileman
2012-11-28 22:45:15 -08:00
parent 8c059f566b
commit d1fb1d86c5
+1 -1
View File
@@ -47,7 +47,7 @@ class StreamLogger extends Mustache_Logger_AbstractLogger
*/
protected function write($level, $message, array $context = array())
{
if ($this->stream === null) {
if (!is_resource($this->stream)) {
if (!isset($this->url)) {
throw new LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().');
}