From 7b5b3205558717de474a2e77b8b3eea768a38f0e Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sat, 3 Dec 2016 22:32:19 +0100 Subject: add log file support --- src/phinde/Log.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/phinde') diff --git a/src/phinde/Log.php b/src/phinde/Log.php index 2369a2b..cc8cf12 100644 --- a/src/phinde/Log.php +++ b/src/phinde/Log.php @@ -17,7 +17,16 @@ class Log public static function log($msg) { - echo $msg . "\n"; + if (isset($GLOBALS['phinde']['logfile']) + && $GLOBALS['phinde']['logfile'] != '' + ) { + file_put_contents( + $GLOBALS['phinde']['logfile'], + $msg . "\n", FILE_APPEND + ); + } else { + echo $msg . "\n"; + } } } ?> -- cgit v1.2.3