From 8ca756d0eeb5f85694ca8fb13db28b2ab88eb51a Mon Sep 17 00:00:00 2001 From: zj Date: Thu, 6 Aug 2026 09:05:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=AC=E5=85=B1=E5=87=BD?= =?UTF-8?q?=E6=95=B0=EF=BC=9A=E7=AE=80=E5=8D=95=E6=97=A5=E5=BF=97=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Library/Util.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Library/Util.php b/src/Library/Util.php index b6ea7bf..2d58577 100644 --- a/src/Library/Util.php +++ b/src/Library/Util.php @@ -44,6 +44,22 @@ final class Util return new Logger(); } + /** + * 简单日志记录 + * @param string $message 日志信息 + * @param array|null $data 日志数据 + * @return void + */ + public static function simpleLog(string $message, ?array $data = null): void + { + $logger = self::logger(); + $logger->setMessage($message); + if ($data !== null) { + $logger->setData($data); + } + $logger->record(); + } + /** * 从原始数据中提取指定字段的值,并可进行键名映射、设置默认值和字符串裁剪 *