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9.3
broken-link-checker / logger.php
broken-link-checker Last commit date
css 16 years ago images 16 years ago includes 15 years ago js 16 years ago languages 15 years ago JSON.php 17 years ago broken-link-checker.php 15 years ago config-manager.php 16 years ago core.php 15 years ago logger.php 16 years ago readme.txt 15 years ago uninstall.php 16 years ago utility-class.php 16 years ago
logger.php
153 lines
1 <?php
2
3 //TODO: Add comments
4
5 if ( !class_exists('blcLogger') ):
6
7 define('BLC_LEVEL_DEBUG', 0);
8 define('BLC_LEVEL_INFO', 1);
9 define('BLC_LEVEL_WARNING', 2);
10 define('BLC_LEVEL_ERROR', 3);
11
12 class blcLogger {
13
14 function __construct($param = ''){
15
16 }
17
18 function blcLogger($param = ''){
19 $this->__construct($param);
20 }
21
22 function log($message, $object = null, $level = BLC_LEVEL_DEBUG){
23
24 }
25
26 function debug($message, $object = null){
27 $this->log($message, $object, BLC_LEVEL_DEBUG);
28 }
29
30 function info($message, $object = null){
31 $this->log($message, $object, BLC_LEVEL_INFO);
32 }
33
34 function warn($message, $object = null){
35 $this->log($message, $object, BLC_LEVEL_WARNING);
36 }
37
38 function error($message, $object = null){
39 $this->log($message, $object, BLC_LEVEL_ERROR);
40 }
41
42 function get_messages($min_level = BLC_LEVEL_DEBUG){
43 return array();
44 }
45
46 function get_log($min_level = BLC_LEVEL_DEBUG){
47 return array();
48 }
49
50 function clear(){
51
52 }
53 }
54
55 class blcOptionLogger extends blcLogger{
56
57 var $option_name = '';
58 var $filter_level = 0;
59
60 function __construct( $option_name = '' ){
61 $this->option_name = $option_name;
62 }
63
64 function log($message, $object = null, $level = BLC_LEVEL_DEBUG){
65 $current = get_option($this->option_name);
66 $new_entry = array($level, $message, $object);
67
68 if ( empty($current) ){
69 $current = array( $new_entry );
70 } else {
71 array_push($current, $new_entry);
72 }
73
74 update_option($this->option_name, $current);
75 }
76
77 function get_log($min_level = BLC_LEVEL_DEBUG){
78 $log = get_option($this->option_name);
79 if ( empty($log) || !is_array($log) ){
80 return array();
81 }
82
83 $this->filter_level = $min_level;
84 return array_filter($log, array($this, '_filter_log'));
85 }
86
87 function _filter_log($entry){
88 return ( $entry[0] >= $this->filter_level );
89 }
90
91 function get_messages($min_level = BLC_LEVEL_DEBUG){
92 $messages = $this->get_log($min_level);
93 return array_map( array($this, '_get_log_message'), $messages );
94 }
95
96 function _get_log_message($entry){
97 return $entry[1];
98 }
99
100 function clear(){
101 delete_option($this->option_name);
102 }
103 }
104
105 class blcMemoryLogger extends blcLogger {
106
107 var $log;
108 var $name = '';
109 var $filter_level = BLC_LEVEL_DEBUG;
110
111
112 function __construct($name = ''){
113 $this->name = $name;
114 $this->log = array();
115 }
116
117 function log($message, $object = null, $level = BLC_LEVEL_DEBUG){
118 $new_entry = array($level, $message, $object);
119 array_push($this->log, $new_entry);
120 }
121
122 function get_log($min_level = BLC_LEVEL_DEBUG){
123 $this->filter_level = $min_level;
124 return array_filter($this->log, array($this, '_filter_log'));
125 }
126
127 function _filter_log($entry){
128 return ( $entry[0] >= $this->filter_level );
129 }
130
131 function get_messages($min_level = BLC_LEVEL_DEBUG){
132 $messages = $this->get_log($min_level);
133 return array_map( array($this, '_get_log_message'), $messages );
134 }
135
136 function _get_log_message($entry){
137 return $entry[1];
138 }
139
140 function clear(){
141 $this->log = array();
142 }
143 }
144
145 class blcDummyLogger extends blcLogger {
146
147 }
148
149 endif;
150
151
152
153 ?>