Ignore:
Timestamp:
Mar 31, 2010, 1:32:46 PM (15 years ago)
Author:
Pieter Naber
Message:

Updated ErrorHandler to use our LogHandler. Updated LogHandler with an adjustable error level.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/inc/FileHandler.class.php

    r7631 r7637  
    1616        public function __construct($filename) {
    1717                try {
     18                        trigger_log(SYSLOG_DEBUG, 'Opening the file "' . $filename . '"', __FILE__, __LINE__);
    1819                        $handle = fopen($filename, 'r');
     20
     21                        trigger_log(SYSLOG_DEBUG, 'Reading from file "' . $filename . '"', __FILE__, __LINE__);
    1922                        $this->file = '';
    2023                        while (!feof($handle)) {
    2124                                $this->file .= fread($handle, 8192);
    2225                        }
     26
     27                        trigger_log(SYSLOG_DEBUG, 'Closing file "' . $filename . '"', __FILE__, __LINE__);
    2328                        fclose($handle);
     29
     30                        trigger_log(SYSLOG_INFO, 'Reading from file "' . $filename . '" is done', __FILE__, __LINE__);
    2431                } catch (Exception $err) {
    2532                        // TODO: Better error description
    26                         trigger_error();
     33                        trigger_log(SYSLOG_ERR, 'Reading from file "' . $filename . '" failed', __FILE__, __LINE__);
    2734                }
    2835        }
Note: See TracChangeset for help on using the changeset viewer.