CC-4045: Logging: add file name and line number on logging function

- done
This commit is contained in:
James 2012-06-29 12:47:14 -04:00
parent e5e0c925e6
commit b425fbd894
1 changed files with 8 additions and 2 deletions

View File

@ -35,14 +35,20 @@ class Logging {
}
public static function log($p_msg){
$bt = debug_backtrace();
$caller = array_shift($bt);
$logger = self::getLogger();
$logger->info(self::toString($p_msg));
$logger->info(self::toString($p_msg)." - file:".$caller['file'].":".$caller['line']);
}
public static function debug($p_msg){
$bt = debug_backtrace();
$caller = array_shift($bt);
if (defined('APPLICATION_ENV') && APPLICATION_ENV == "development"){
$logger = self::getLogger();
$logger->debug(self::toString($p_msg));
$logger->debug(self::toString($p_msg)." - file:".$caller['file'].":".$caller['line']);
}
}
}