From 77750ab4cc4c0055a29352334a9357d74e3957d3 Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 5 Jan 2006 01:13:15 +0000 Subject: coreLog instrumentation. --- framework/Log/TEventLog.php | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) (limited to 'framework/Log/TEventLog.php') diff --git a/framework/Log/TEventLog.php b/framework/Log/TEventLog.php index d291d3f5..8fb56618 100644 --- a/framework/Log/TEventLog.php +++ b/framework/Log/TEventLog.php @@ -1,7 +1,7 @@ collectInternalLog(); + } + + public function __destruct() + { + $this->collectInternalLog(); + } + + protected function collectInternalLog() + { + foreach(Prado::coreLog()->entries as $entry) + $this->log($entry[0], $entry[1], $entry[2]); + Prado::coreLog()->entries = array(); + } public function info($msg, $source='Prado', $category='main') { - ezcLog::getInstance()->log($msg, ezcLog::INFO, + $this->log($msg, ezcLog::INFO, array('source'=>$source, 'category'=>$category)); } public function debug($msg, $source='Prado', $category='main') { - ezcLog::getInstance()->log($msg, ezcLog::DEBUG, + $this->log($msg, ezcLog::DEBUG, array('source'=>$source, 'category'=>$category)); } public function notice($msg, $source='Prado', $category='main') { - ezcLog::getInstance()->log($msg, ezcLog::NOTICE, + $this->log($msg, ezcLog::NOTICE, array('source'=>$source, 'category'=>$category)); } public function warn($msg, $source='Prado', $category='main') { - ezcLog::getInstance()->log($msg, ezcLog::WARNING, + $this->log($msg, ezcLog::WARNING, array('source'=>$source, 'category'=>$category)); } public function error($msg, $source='Prado', $category='main') { - ezcLog::getInstance()->log($msg, ezcLog::NOTICE, + $this->log($msg, ezcLog::NOTICE, array('source'=>$source, 'category'=>$category)); } public function fatal($msg, $source='Prado', $category='main') { - ezcLog::getInstance()->log($msg, ezcLog::NOTICE, + $this->log($msg, ezcLog::NOTICE, array('source'=>$source, 'category'=>$category)); } + + protected function log($msg, $code, $info) + { + ezcLog::getInstance()->log($msg, $code, $info); + } } ?> \ No newline at end of file -- cgit v1.2.3