From fec89f374df35dc6359f4e694d60df9fa2fe80e9 Mon Sep 17 00:00:00 2001 From: penll Date: Fri, 1 Aug 2025 01:26:56 +0000 Subject: [PATCH] =?UTF-8?q?update=20harmony=5Futils/src/main/ets/utils/Log?= =?UTF-8?q?Util.ets.=20=E4=BF=AE=E6=94=B9=E5=90=8E=EF=BC=8C=E5=8D=B3?= =?UTF-8?q?=E5=8F=AF=E8=BF=99=E6=A0=B7=E8=BE=93=E5=87=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=9ALogUtil.debug('=E8=BF=99=E6=98=AF=E4=B8=80=E6=9D=A1?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF',=20new=20Error())?= =?UTF-8?q?=EF=BC=9B=20=E4=B9=8B=E5=89=8D=E6=97=A0=E6=B3=95=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E5=92=8Cobject=E5=90=8C=E6=97=B6=E8=BE=93?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: penll --- harmony_utils/src/main/ets/utils/LogUtil.ets | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/harmony_utils/src/main/ets/utils/LogUtil.ets b/harmony_utils/src/main/ets/utils/LogUtil.ets index 04d8f48..596d6bc 100644 --- a/harmony_utils/src/main/ets/utils/LogUtil.ets +++ b/harmony_utils/src/main/ets/utils/LogUtil.ets @@ -83,7 +83,7 @@ export class LogUtil { * 打印DEBUG级别日志 * @param args */ - static debug(...args: string[] | object[]): void { + static debug(...args: (string | object)[]): void { LogUtil.uniLog(args, hilog.LogLevel.DEBUG); } @@ -91,7 +91,7 @@ export class LogUtil { * 打印INFO级别日志 * @param args */ - static info(...args: string[] | object[]): void { + static info(...args: (string | object)[]): void { LogUtil.uniLog(args, hilog.LogLevel.INFO); } @@ -99,7 +99,7 @@ export class LogUtil { * 打印WARN级别日志 * @param args */ - static warn(...args: string[] | object[]): void { + static warn(...args: (string | object)[]): void { LogUtil.uniLog(args, hilog.LogLevel.WARN); } @@ -107,7 +107,7 @@ export class LogUtil { * 打印ERROR级别日志 * @param args */ - static error(...args: string[] | object[]): void { + static error(...args: (string | object)[]): void { LogUtil.uniLog(args, hilog.LogLevel.ERROR); } @@ -115,7 +115,7 @@ export class LogUtil { * 打印FATAL级别日志 * @param args */ - static fatal(...args: string[] | object[]): void { + static fatal(...args: (string | object)[]): void { LogUtil.uniLog(args, hilog.LogLevel.FATAL); } @@ -160,7 +160,7 @@ export class LogUtil { /** * 统一日志输出 */ - private static uniLog(message: string[] | object[], level: hilog.LogLevel) { + private static uniLog(message: (string | object)[], level: hilog.LogLevel) { if (!LogUtil.showLog) { return; //不打印日志 } @@ -231,7 +231,7 @@ export class LogUtil { /** * 获取格式化日志内容 */ - private static getMessage(message: string[] | object[]): string { + private static getMessage(message: (string | object)[]): string { try { let logMessage = ''; message.forEach((msg: string | object) => { -- Gitee