diff --git a/harmony_utils/src/main/ets/utils/LogUtil.ets b/harmony_utils/src/main/ets/utils/LogUtil.ets index 04d8f4820da5d41c6dd8db6db92052b2dc58fcdd..596d6bcf1c527344991c8d9e5b206f0c3839c54b 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) => {