diff options
author | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-03-14 20:14:52 +0000 |
---|---|---|
committer | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-03-14 20:14:52 +0000 |
commit | 1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc (patch) | |
tree | 54655ff3e692a71a17f1d37cd97374b263557ca1 /lib/log.lib.php | |
parent | ef48bf3fbdca2a4d25f5d025f4c6ad23905e5369 (diff) | |
download | ampache-1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc.tar.gz ampache-1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc.tar.bz2 ampache-1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc.zip |
Cosmetics: remove trailing whitespace
Diffstat (limited to 'lib/log.lib.php')
-rw-r--r-- | lib/log.lib.php | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/lib/log.lib.php b/lib/log.lib.php index 5be7e780..0b3e3587 100644 --- a/lib/log.lib.php +++ b/lib/log.lib.php @@ -25,21 +25,21 @@ @discussion logs an event either to a database or to a defined log file based on config options */ -function log_event($username='Unknown',$event_name,$event_description,$log_name='ampache') { +function log_event($username='Unknown',$event_name,$event_description,$log_name='ampache') { /* Set it up here to make sure it's _always_ the same */ $log_time = time(); /* must have some name */ - if (!strlen($log_name)) { $log_name = 'ampache'; } + if (!strlen($log_name)) { $log_name = 'ampache'; } - $username = $username ? $username : 'ampache'; + $username = $username ? $username : 'ampache'; $log_filename = Config::get('log_path') . "/$log_name." . date("Ymd",$log_time) . ".log"; - $log_line = date("Y-m-d H:i:s",$log_time) . " [$username] ($event_name) -> $event_description \n"; + $log_line = date("Y-m-d H:i:s",$log_time) . " [$username] ($event_name) -> $event_description \n"; $log_write = error_log($log_line, 3, $log_filename); - - if (!$log_write) { + + if (!$log_write) { echo "Warning: Unable to write to log ($log_filename) Please check your log_path variable in ampache.cfg.php"; } @@ -50,12 +50,12 @@ function log_event($username='Unknown',$event_name,$event_description,$log_name= @discussion an error handler for ampache that traps as many errors as it can and logs em */ -function ampache_error_handler($errno, $errstr, $errfile, $errline) { +function ampache_error_handler($errno, $errstr, $errfile, $errline) { /* Default level of 1 */ $level = 1; - - switch ($errno) { + + switch ($errno) { case '2': $error_name = "Runtime Error"; break; @@ -81,36 +81,36 @@ function ampache_error_handler($errno, $errstr, $errfile, $errline) { $level = 2; break; } // end switch - + /* Don't log var: Deprecated we know shutup! * Yea now getid3() spews errors I love it :( */ if (strstr($errstr,"var: Deprecated. Please use the public/private/protected modifiers") OR strstr($errstr,"getimagesize() [") OR strstr($errstr,"Non-static method getid3") OR - strstr($errstr,"Assigning the return value of new by reference is deprecated")) { - return false; + strstr($errstr,"Assigning the return value of new by reference is deprecated")) { + return false; } - if (strstr($errstr,"date.timezone")) { - $error_name = "Warning"; - $errstr = "You have not set a valid timezone (date.timezone) in your php.ini file. This may cause display issues with dates. This warning is non-critical and not caused by Ampache."; - } + if (strstr($errstr,"date.timezone")) { + $error_name = "Warning"; + $errstr = "You have not set a valid timezone (date.timezone) in your php.ini file. This may cause display issues with dates. This warning is non-critical and not caused by Ampache."; + } - /* The XML-RPC lib is broken, well kind of - * shut your pie hole + /* The XML-RPC lib is broken, well kind of + * shut your pie hole */ - if (strstr($errstr,"used as offset, casting to integer")) { - return false; + if (strstr($errstr,"used as offset, casting to integer")) { + return false; } $log_line = "[$error_name] $errstr in file $errfile($errline)"; debug_event('PHP Error',$log_line,$level); - + // When a dir is defined lets log it to a logfile - if (Config::get('log_path') != "") + if (Config::get('log_path') != "") log_event("ampache","PHP Error", $log_line); - + } // ampache_error_handler /** @@ -119,13 +119,13 @@ function ampache_error_handler($errno, $errstr, $errfile, $errline) { * log_event. It checks for conf('debug') and conf('debug_level') and only * calls log event if both requirements are met. */ -function debug_event($type,$message,$level,$file='',$username='') { +function debug_event($type,$message,$level,$file='',$username='') { - if (!Config::get('debug') || $level > Config::get('debug_level')) { + if (!Config::get('debug') || $level > Config::get('debug_level')) { return false; } - if (!$username) { + if (!$username) { $username = $GLOBALS['user']->username; } |