diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-02-20 10:11:24 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-02-20 10:11:24 +0000 |
commit | 7db588f7da78af36dc8d520f9ad4010ebb3f1a81 (patch) | |
tree | 60a17e174190d28d8b8145a2f3b9210327c02b73 | |
parent | 88259f55a3b7ae564acf8ba89e4c4420852b17c7 (diff) | |
download | ampache-7db588f7da78af36dc8d520f9ad4010ebb3f1a81.tar.gz ampache-7db588f7da78af36dc8d520f9ad4010ebb3f1a81.tar.bz2 ampache-7db588f7da78af36dc8d520f9ad4010ebb3f1a81.zip |
tweaked some debug stuff and the error handler
-rw-r--r-- | config/ampache.cfg.php.dist | 19 | ||||
-rwxr-xr-x | docs/CHANGELOG | 2 | ||||
-rw-r--r-- | lib/log.lib.php | 15 | ||||
-rw-r--r-- | modules/init.php | 3 |
4 files changed, 19 insertions, 20 deletions
diff --git a/config/ampache.cfg.php.dist b/config/ampache.cfg.php.dist index 33d61a3e..df995abe 100644 --- a/config/ampache.cfg.php.dist +++ b/config/ampache.cfg.php.dist @@ -138,15 +138,9 @@ use_auth = "yes" # comment before the value flash requires flash player and # will cause longer load times. # POSSIBLE VALUES: false normal -# DEFAULT: normal +# DEFAULT: false #ratings = "normal" -# This enables the ability to use custom colors for the ratings. -# This option MUST be set in order to use custom colors. -# DEFAULT: false, use the default colorset -# true: use custom colors, loaded from /templates/ratings_colors.php -#custom_ratings_colors = "false" - # This options will turn on/off Demo Mode # If Demo mode is on you can not play songs or update your catalog # in other words.. leave this commented out @@ -244,9 +238,10 @@ debug_level = 5 # Path to Log File # This defines where you want ampache to log events to # this will only happen if debug is turned on. Do not -# include trailing slash. Default is /tmp -# DEFAULT: /tmp -#log_path = "/tmp" +# include trailing slash. You will need to make sure that +# your HTTP server has write access to the specified directory +# DEFAULT: /var/log/ampache +#log_path = "/var/log/ampache" # Max Upload Size # This sets what the max file-size for an uploaded @@ -535,8 +530,8 @@ rss_main_language = nl # This defines the file that the tracklist # for icecast is written to, this file must # be writable by the web server process -# DEFAULT: /tmp/tracklist.txt -#icecast_tracklist = "/tmp/tracklist.txt" +# DEFAULT: /private/ampache/icecast/tracklist.txt +#icecast_tracklist = "/private/ampache/icecast/tracklist.txt" # Icecast Command # This is the command that is run when ampache diff --git a/docs/CHANGELOG b/docs/CHANGELOG index f1b8241c..a2a093c7 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,8 @@ -------------------------------------------------------------------------- v.3.3.2-Beta2 + - Tweaked some defaults in .dist config file as well as the error + handler, in order to account for debug_level - Added catalog drop down back to quick random play form - Added bandwidth throttling to downloads, must be enabled in config (Thx pb1dft) diff --git a/lib/log.lib.php b/lib/log.lib.php index 6c48945e..d8e68014 100644 --- a/lib/log.lib.php +++ b/lib/log.lib.php @@ -30,13 +30,14 @@ function log_event($username='Unknown',$event_name,$event_description,$log_name= /* Set it up here to make sure it's _always_ the same */ $log_time = time(); - set_time_limit(0); - $log_filename = conf('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"; - - error_log($log_line, 3, $log_filename) or die("Error: Unable to write to log ($log_filename) Please check your log_path variable in ampache.cfg.php"); + $log_write = error_log($log_line, 3, $log_filename); + + if (!$log_write) { + echo "Error: Unable to write to log ($log_filename) Please check your log_path variable in ampache.cfg.php"; + } } // log_event @@ -47,6 +48,9 @@ function log_event($username='Unknown',$event_name,$event_description,$log_name= */ function ampache_error_handler($errno, $errstr, $errfile, $errline) { + /* Default level of 1 */ + $level = 1; + switch ($errno) { case '2': $error_name = "Runtime Error"; @@ -70,12 +74,13 @@ function ampache_error_handler($errno, $errstr, $errfile, $errline) { break; default: $error_name = "Error"; + $level = 2; break; } // end switch $log_line = "[$error_name] $errstr on line $errline in $errfile"; - log_event($_SESSION['userdata']['username'],'error',$log_line,'ampache-error'); + debug_event('error',$log_line,$level); } // ampache_error_handler diff --git a/modules/init.php b/modules/init.php index b4ccffa9..f361a7fd 100644 --- a/modules/init.php +++ b/modules/init.php @@ -100,9 +100,6 @@ if (!$results['http_port']) { if (!$results['site_charset']) { $results['site_charset'] = "iso-8859-1"; } -if (!$results['log_path']) { - $results['log_path'] = '/tmp'; -} if (!$results['ellipse_threshold_album']) { $results['ellipse_threshold_album'] = 27; } |