浏览代码

Pretty print object when log into file

Ishan Vyas 5 年之前
父节点
当前提交
9221ff81b8
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Utility/Log.php

+ 2 - 2
src/Utility/Log.php

@@ -52,8 +52,8 @@ class Log {
 	public static function write($data, $filename = null, $traceKey = false) {
 		static::_init($filename);
 
-		// Pretty print array
-		if (is_array($data)) {
+		// Pretty print array or object
+		if (is_array($data) || is_object($data)) {
 			if ($traceKey) {
 				try {
 					throw new Exception('Trace string', 1);