Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

error_logger.php

Go to the documentation of this file.
00001 
00002 /** @file error_logger.php
00003 * Definition of class error_logger.
00004 */
00005 /**
00006 * Logs errors.
00007 * This class is an attempt to create class that will be used to log errors
00008 * during execution of functions - members of derrived classes.
00009 * @todo Add logging to file.
00010 */
00011 class error_logger
00012 {
00013 public:
00014   /**
00015   * Log error.
00016   * @param what - error reason
00017   * @param func - function name in which an error had uccured
00018   * @param line - source line
00019   * @param file - name of source file
00020   * @param terminate - 1 to terminate script processing
00021   * @return zero
00022   */
00023   function err( what, func = '', line = 0, file = '', terminate = 1 )
00024   {
00025     echo 
00026       '<b>'.
00027       get_class( this ).
00028       '</b>'.
00029       ( terminate !=0 ? ' fatal' : '' ).
00030       " error".
00031       ( func != '' ? ' in '.func.'()' : '' ).
00032       ( what != '' ? " <b>\"".what."\"</b>" : '' ).
00033       ( line != 0 ? ' on line '.line : '' ).
00034       ( file != '' ? ' in file '.basename( file ) : '' ).
00035       '<br>';
00036     if( terminate )
00037         die();
00038     return 0;
00039   }
00040 }X-Powered-By: PHP/4.0.8-dev
00041 Content-type: text/html
00042 
00043 

Generated on Tue Mar 11 08:35:12 2003 for SES by doxygen1.2.16