{
public static function error($msg)
{
- static::log($msg);
+ static::log($msg, 'php://stderr');
}
public static function info($msg)
}
}
- public static function log($msg)
+ public static function log($msg, $stream = 'php://stdout')
{
- echo $msg . "\n";
+ if (isset($GLOBALS['phinde']['logfile'])
+ && $GLOBALS['phinde']['logfile'] != ''
+ ) {
+ file_put_contents(
+ $GLOBALS['phinde']['logfile'],
+ $msg . "\n", FILE_APPEND
+ );
+ } else {
+ fwrite($stream, $msg . "\n");
+ }
}
}
?>