From fd7593c72b0d27467451948d32e608d7a3ceff09 Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Wed, 10 Dec 2025 10:17:54 +0800 Subject: [PATCH] =?UTF-8?q?chore(src):=20log=5Fwrite=20=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AE=E8=B0=83=E7=94=A8=E6=A0=88?= =?UTF-8?q?=E6=B7=B1=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/common.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/common.php b/src/app/common.php index ff1056f6a..edc2d1e6a 100644 --- a/src/app/common.php +++ b/src/app/common.php @@ -2135,12 +2135,13 @@ function exportForLog($data): string * @param string $msg 日志内容 * @param string $level 日志级别 debug、info、warning、error * @param string $file 日志文件名(不含路径) + * @param int $callerDep 调用栈深度,默认1(当前函数调用) */ -function log_write(string $message, string $level = 'info', string $filename = ''): void +function log_write(string $message, string $level = 'info', string $filename = '', int $callerDep = 1): void { // 日志文件最大大小(字节) $maxFileSize = 10485760; // 10MB - $callerInfo = CallerInfo::getCallerInfo(1); + $callerInfo = CallerInfo::getCallerInfo($callerDep); // 格式化日志内容 $content = sprintf(