source: trunk/src/class/LogHandler.class.php@ 7627

Last change on this file since 7627 was 7627, checked in by Pieter Naber, 13 years ago

Added new classes for creating KMLFiles.

File size: 2.4 KB
Line 
1<?
2/*
3 * Project: NodeMap2.0
4 * File: LogHandler.class.php
5 * Purpose: Handling our log file containing log entries generated by the application
6 */
7
8/*
9 * Log levels:
10 * LOG_EMERG System is unusable
11 * LOG_ALERT Action must be taken immediately
12 * LOG_CRIT Critical conditions
13 * LOG_ERR Error conditions
14 * LOG_WARNING Warning conditions
15 * LOG_NOTICE Normal, but significant, condition
16 * LOG_INFO Informational message
17 * LOG_DEBUG Debug-level message
18 */
19
20define('LOG_EMERG', 0);
21define('LOG_ALERT', 1);
22define('LOG_CRIT', 2);
23define('LOG_ERR', 3);
24define('LOG_WARNING', 4);
25define('LOG_NOTICE', 5);
26define('LOG_INFO', 6);
27define('LOG_DEBUG', 7);
28
29class LogHandler {
30 /*
31 * Function: LogHandler
32 * Parameters: int $logno, string $logstr, string $logfile, int $logline
33 * Function: Handling with log entries, decides what to do with it
34 */
35 public function LogHandler(int $logno, string $logstr, string $logfile, int $logline) {
36 switch ($logno) {
37 case LOG_EMERG:
38 echo 'LOG_EMERG: ' , $logno , ': ' , $logstr , '<br/>Bestand: ' , $logfile , '<br/>Regel: ' , $logline , '<br/>';
39 // TODO
40 break;
41 case LOG_ALERT:
42 echo 'LOG_ALERT: ' , $logno , ': ' , $logstr , '<br/>Bestand: ' , $logfile , '<br/>Regel: ' , $logline , '<br/>';
43 // TODO
44 break;
45 case LOG_CRIT:
46 echo 'LOG_CRIT: ' , $logno , ': ' , $logstr , '<br/>Bestand: ' , $logfile , '<br/>Regel: ' , $logline , '<br/>';
47 // TODO
48 break;
49 case LOG_ERR:
50 echo 'LOG_ERR: ' , $logno , ': ' , $logstr , '<br/>Bestand: ' , $logfile , '<br/>Regel: ' , $logline , '<br/>';
51 // TODO
52 break;
53 case LOG_WARNING:
54 echo 'LOG_WARNING: ' , $logno , ': ' , $logstr , '<br/>Bestand: ' , $logfile , '<br/>Regel: ' , $logline , '<br/>';
55 // TODO
56 break;
57 case LOG_NOTICE:
58 echo 'LOG_NOTICE: ' , $logno , ': ' , $logstr , '<br/>Bestand: ' , $logfile , '<br/>Regel: ' , $logline , '<br/>';
59 // TODO
60 break;
61 case LOG_INFO:
62 echo 'LOG_INFO: ' , $logno , ': ' , $logstr , '<br/>Bestand: ' , $logfile , '<br/>Regel: ' , $logline , '<br/>';
63 // TODO
64 break;
65 case LOG_DEBUG:
66 echo 'LOG_DEBUG: ' , $logno , ': ' , $logstr , '<br/>Bestand: ' , $logfile , '<br/>Regel: ' , $logline , '<br/>';
67 // TODO
68 break;
69 default:
70 echo 'LOG_DEFAULT: ' , $logno , ': ' , $logstr , '<br/>Bestand: ' , $logfile , '<br/>Regel: ' , $logline , '<br/>';
71 // TODO
72 break;
73 }
74 }
75}
76?>
Note: See TracBrowser for help on using the repository browser.