# HG changeset patch # User Tom Fredrik "BFG" Klaussen # Date 1349980384 -7200 # Node ID 164268b4e0d950083fdbe566845cfc6e8e5f16ef # Parent 92c3e52c12d4863dcdba7f4d2d5db40076791caf Make class of logger. diff -r 92c3e52c12d4 -r 164268b4e0d9 CacheTimeCheck.inc --- a/CacheTimeCheck.inc Thu Oct 11 20:26:27 2012 +0200 +++ b/CacheTimeCheck.inc Thu Oct 11 20:33:04 2012 +0200 @@ -95,7 +95,7 @@ function cache_time($path) { if (!file_exists($path)) { - warn("${path} does not exist"); + Logger::warn("${path} does not exist"); errorPage("Resource is not available"); } diff -r 92c3e52c12d4 -r 164268b4e0d9 logger.inc --- a/logger.inc Thu Oct 11 20:26:27 2012 +0200 +++ b/logger.inc Thu Oct 11 20:33:04 2012 +0200 @@ -3,17 +3,19 @@ * @file * Common access point for logging */ -function logMsg($level, $msg) -{ - if (DEBUG_LEVEL >= $level) { - print $msg; - if(ABORT_ON_LOG) - exit; +class Logger { + static function msg($level, $msg) + { + if (DEBUG_LEVEL >= $level) { + print $msg; + if(ABORT_ON_LOG) + exit; + } + } + + static function warn($msg) + { + self::msg(VERBOSITY_WARNING, $msg); } } - -function warn($msg) -{ - logMsg(VERBOSITY_WARNING, $msg); -} ?> \ No newline at end of file