/*
* Project: NodeMap2.0
* File: LogHandler.class.php
* Purpose: Handling our log file containing log entries generated by the application
*/
/*
* Log levels:
* LOG_EMERG System is unusable
* LOG_ALERT Action must be taken immediately
* LOG_CRIT Critical conditions
* LOG_ERR Error conditions
* LOG_WARNING Warning conditions
* LOG_NOTICE Normal, but significant, condition
* LOG_INFO Informational message
* LOG_DEBUG Debug-level message
*/
define('LOG_EMERG', 0);
define('LOG_ALERT', 1);
define('LOG_CRIT', 2);
define('LOG_ERR', 3);
define('LOG_WARNING', 4);
define('LOG_NOTICE', 5);
define('LOG_INFO', 6);
define('LOG_DEBUG', 7);
class LogHandler {
/*
* Function: LogHandler
* Parameters: int $logno, string $logstr, string $logfile, int $logline
* Function: Handling with log entries, decides what to do with it
*/
public function LogHandler(int $logno, string $logstr, string $logfile, int $logline) {
switch ($logno) {
case LOG_EMERG:
echo 'LOG_EMERG: ' , $logno , ': ' , $logstr , '
Bestand: ' , $logfile , '
Regel: ' , $logline , '
';
// TODO
break;
case LOG_ALERT:
echo 'LOG_ALERT: ' , $logno , ': ' , $logstr , '
Bestand: ' , $logfile , '
Regel: ' , $logline , '
';
// TODO
break;
case LOG_CRIT:
echo 'LOG_CRIT: ' , $logno , ': ' , $logstr , '
Bestand: ' , $logfile , '
Regel: ' , $logline , '
';
// TODO
break;
case LOG_ERR:
echo 'LOG_ERR: ' , $logno , ': ' , $logstr , '
Bestand: ' , $logfile , '
Regel: ' , $logline , '
';
// TODO
break;
case LOG_WARNING:
echo 'LOG_WARNING: ' , $logno , ': ' , $logstr , '
Bestand: ' , $logfile , '
Regel: ' , $logline , '
';
// TODO
break;
case LOG_NOTICE:
echo 'LOG_NOTICE: ' , $logno , ': ' , $logstr , '
Bestand: ' , $logfile , '
Regel: ' , $logline , '
';
// TODO
break;
case LOG_INFO:
echo 'LOG_INFO: ' , $logno , ': ' , $logstr , '
Bestand: ' , $logfile , '
Regel: ' , $logline , '
';
// TODO
break;
case LOG_DEBUG:
echo 'LOG_DEBUG: ' , $logno , ': ' , $logstr , '
Bestand: ' , $logfile , '
Regel: ' , $logline , '
';
// TODO
break;
default:
echo 'LOG_DEFAULT: ' , $logno , ': ' , $logstr , '
Bestand: ' , $logfile , '
Regel: ' , $logline , '
';
// TODO
break;
}
}
}
?>