-Logging::log works with arrays

This commit is contained in:
Martin Konecny 2012-04-13 16:50:54 -04:00
parent 377fb509a1
commit 2e4cab45b3
1 changed files with 10 additions and 2 deletions

View File

@ -17,15 +17,23 @@ class Logging {
self::$_path = $path;
}
public static function toString($p_msg){
if (is_array($p_msg)){
return print_r($p_msg, true);
} else {
return $p_msg;
}
}
public static function log($p_msg){
$logger = self::getLogger();
$logger->info($p_msg);
$logger->info(self::toString($p_msg));
}
public static function debug($p_msg){
if (defined('APPLICATION_ENV') && APPLICATION_ENV == "development"){
$logger = self::getLogger();
$logger->debug($p_msg);
$logger->debug(self::toString($p_msg));
}
}
}