git.cweiske.de
/
phinde.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6890627
)
Write errors to stderr
author
Christian Weiske
<
[email protected]
>
Fri, 17 Apr 2020 12:03:55 +0000
(14:03 +0200)
committer
Christian Weiske
<
[email protected]
>
Fri, 17 Apr 2020 12:03:55 +0000
(14:03 +0200)
src/phinde/Log.php
patch
|
blob
|
history
diff --git
a/src/phinde/Log.php
b/src/phinde/Log.php
index cc8cf1224e053ea03da334eb156d9e87bfd40c99..36a126b5f5f71a36a88cb98ec5f17472eb5e143b 100644
(file)
--- 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")
;
}
}
}