aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2020-04-17 14:03:55 +0200
committerChristian Weiske <cweiske@cweiske.de>2020-04-17 14:03:55 +0200
commit0eb3df8b6ac67c5fa4562b6362425f4a473da644 (patch)
tree06329b1863c42e176b26ca9753a1d1f963161caa
parent68906273b5caf36fb72f9bda40b0fcb5c728568d (diff)
downloadphinde-0eb3df8b6ac67c5fa4562b6362425f4a473da644.tar.gz
phinde-0eb3df8b6ac67c5fa4562b6362425f4a473da644.zip
Write errors to stderr
-rw-r--r--src/phinde/Log.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/phinde/Log.php b/src/phinde/Log.php
index cc8cf12..36a126b 100644
--- a/src/phinde/Log.php
+++ b/src/phinde/Log.php
@@ -5,7 +5,7 @@ class Log
{
public static function error($msg)
{
- static::log($msg);
+ static::log($msg, STDERR);
}
public static function info($msg)
@@ -15,7 +15,7 @@ class Log
}
}
- public static function log($msg)
+ public static function log($msg, $stream = STDOUT)
{
if (isset($GLOBALS['phinde']['logfile'])
&& $GLOBALS['phinde']['logfile'] != ''
@@ -25,7 +25,7 @@ class Log
$msg . "\n", FILE_APPEND
);
} else {
- echo $msg . "\n";
+ fwrite($stream, $msg . "\n");
}
}
}