From c9362afc9e9bbe111d6144c9ed95d47b1c938207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Sat, 20 Feb 2021 16:34:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Abstracts/BaseObject.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/System/Abstracts/BaseObject.php b/System/Abstracts/BaseObject.php index 52ca1a83..cdabe75c 100644 --- a/System/Abstracts/BaseObject.php +++ b/System/Abstracts/BaseObject.php @@ -182,7 +182,13 @@ class BaseObject implements Configure if (!is_string($message)) { $message = print_r($message, true); } - echo "\033[41;37m[ERROR][" . date('Y-m-d H:i:s') . ']: ' . (empty($method) ? '' : $method . ': ') . PHP_EOL . $message . "\033[0m"; + + $length = strlen('[ERROR][2021-02-20 08:32:02]:'); + + $message = PHP_EOL . (empty($method) ? '' : $method . ': ') . $message; + + echo "\033[41;37m[ERROR][" . date('Y-m-d H:i:s') . ']: ' . + str_pad($message, $length, ' ', STR_PAD_LEFT) . "\033[0m"; echo PHP_EOL; }