1 | <?php |
---|
2 | |
---|
3 | class sfPropel13LogWrapper |
---|
4 | { |
---|
5 | protected static $instance = null; |
---|
6 | |
---|
7 | public static function getInstance() |
---|
8 | { |
---|
9 | if (!sfPropel13LogWrapper::$instance) |
---|
10 | { |
---|
11 | // the class exists |
---|
12 | $class = __CLASS__; |
---|
13 | sfPropel13LogWrapper::$instance = new $class(); |
---|
14 | } |
---|
15 | |
---|
16 | return sfPropel13LogWrapper::$instance; |
---|
17 | } |
---|
18 | |
---|
19 | protected function logger() |
---|
20 | { |
---|
21 | return sfLogger::getInstance(); |
---|
22 | } |
---|
23 | |
---|
24 | public function log($message, $priority = SF_LOG_INFO) |
---|
25 | { |
---|
26 | $this->logger()->log('{Propel} ' . $message, $priority); |
---|
27 | } |
---|
28 | |
---|
29 | public function emerg($message) |
---|
30 | { |
---|
31 | $this->log($message, SF_LOG_EMERG); |
---|
32 | } |
---|
33 | |
---|
34 | public function alert($message) |
---|
35 | { |
---|
36 | $this->log($message, SF_LOG_ALERT); |
---|
37 | } |
---|
38 | |
---|
39 | public function crit($message) |
---|
40 | { |
---|
41 | $this->log($message, SF_LOG_CRIT); |
---|
42 | } |
---|
43 | |
---|
44 | public function err($message) |
---|
45 | { |
---|
46 | $this->log($message, SF_LOG_ERR); |
---|
47 | } |
---|
48 | |
---|
49 | public function warning($message) |
---|
50 | { |
---|
51 | $this->log($message, SF_LOG_WARNING); |
---|
52 | } |
---|
53 | |
---|
54 | public function notice($message) |
---|
55 | { |
---|
56 | $this->log($message, SF_LOG_NOTICE); |
---|
57 | } |
---|
58 | |
---|
59 | public function info($message) |
---|
60 | { |
---|
61 | $this->log($message, SF_LOG_INFO); |
---|
62 | } |
---|
63 | |
---|
64 | public function debug($message) |
---|
65 | { |
---|
66 | $this->log($message, SF_LOG_DEBUG); |
---|
67 | } |
---|
68 | } |
---|