git-svn-id: https://msi/svn/firstRepo/Service/branches/Manut_2.2.3@41 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
+7
-2
@@ -6,7 +6,7 @@
|
||||
* @copyright 2011 Josh Lockhart
|
||||
* @link http://www.slimframework.com
|
||||
* @license http://www.slimframework.com/license
|
||||
* @version 2.4.2
|
||||
* @version 2.6.1
|
||||
* @package Slim
|
||||
*
|
||||
* MIT LICENSE
|
||||
@@ -306,7 +306,12 @@ class Log
|
||||
if (!isset(self::$levels[$level])) {
|
||||
throw new \InvalidArgumentException('Invalid log level supplied to function');
|
||||
} else if ($this->enabled && $this->writer && $level <= $this->level) {
|
||||
$message = (string)$object;
|
||||
if (is_array($object) || (is_object($object) && !method_exists($object, "__toString"))) {
|
||||
$message = print_r($object, true);
|
||||
} else {
|
||||
$message = (string) $object;
|
||||
}
|
||||
|
||||
if (count($context) > 0) {
|
||||
if (isset($context['exception']) && $context['exception'] instanceof \Exception) {
|
||||
$message .= ' - ' . $context['exception'];
|
||||
|
||||
Reference in New Issue
Block a user