From 2e4cab45b3aa0510fc02cfa331e68e91c774fa23 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 13 Apr 2012 16:50:54 -0400 Subject: [PATCH] -Logging::log works with arrays --- airtime_mvc/application/logging/Logging.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/logging/Logging.php b/airtime_mvc/application/logging/Logging.php index d6fb070b3..a98b932d7 100644 --- a/airtime_mvc/application/logging/Logging.php +++ b/airtime_mvc/application/logging/Logging.php @@ -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)); } } }