From 90637034ec1dc3c38aff9e27b8220e3afe80d0c7 Mon Sep 17 00:00:00 2001 From: buzhenwang Date: Thu, 31 Jul 2025 11:30:22 +0000 Subject: [PATCH] Change hilog interface with RecordData Signed-off-by: buzhenwang --- api/@ohos.hilog.d.ts | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/api/@ohos.hilog.d.ts b/api/@ohos.hilog.d.ts index e41fa2654e..fddd318930 100644 --- a/api/@ohos.hilog.d.ts +++ b/api/@ohos.hilog.d.ts @@ -16,9 +16,10 @@ /** * @file * @kit PerformanceAnalysisKit - * @arkts 1.1&1.2 */ +import { RecordData } from '@ohos.base'; + /** * Provides interfaces to generate system logs. * @@ -82,6 +83,8 @@ declare namespace hilog { * @atomicservice * @since 11 */ + function debug(domain: number, tag: string, format: string, ...args: any[]): void; + /** * Outputs debug-level logs. * @@ -89,14 +92,14 @@ declare namespace hilog { * if the value exceeds the range, logs cannot be printed. * @param { string } tag Identifies the log tag, length cannot exceed 32 bytes, the excess part will be truncated. * @param { string } format Indicates the log format string. - * @param { (Object | undefined | null)[] }args Indicates the log parameters. + * @param { RecordData[] }args Indicates the log parameters. * @syscap SystemCapability.HiviewDFX.HiLog * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 + * @arkts 1.2 */ - function debug(domain: int, tag: string, format: string, ...args: (Object | undefined | null)[]): void; + function debug(domain: int, tag: string, format: string, ...args: RecordData[]): void; /** * Outputs info-level logs. @@ -134,6 +137,8 @@ declare namespace hilog { * @atomicservice * @since 11 */ + function info(domain: number, tag: string, format: string, ...args: any[]): void; + /** * Outputs info-level logs. * @@ -141,14 +146,14 @@ declare namespace hilog { * if the value exceeds the range, logs cannot be printed. * @param { string } tag Identifies the log tag, length cannot exceed 32 bytes, the excess part will be truncated. * @param { string } format Indicates the log format string. - * @param { (Object | undefined | null)[] }args Indicates the log parameters. + * @param { RecordData[] }args Indicates the log parameters. * @syscap SystemCapability.HiviewDFX.HiLog * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 + * @arkts 1.2 */ - function info(domain: int, tag: string, format: string, ...args: (Object | undefined | null)[]): void; + function info(domain: int, tag: string, format: string, ...args: RecordData[]): void; /** * Outputs warning-level logs. @@ -186,6 +191,8 @@ declare namespace hilog { * @atomicservice * @since 11 */ + function warn(domain: number, tag: string, format: string, ...args: any[]): void; + /** * Outputs warning-level logs. * @@ -193,14 +200,14 @@ declare namespace hilog { * if the value exceeds the range, logs cannot be printed. * @param { string } tag Identifies the log tag, length cannot exceed 32 bytes, the excess part will be truncated. * @param { string } format Indicates the log format string. - * @param { (Object | undefined | null)[] }args Indicates the log parameters. + * @param { RecordData[] }args Indicates the log parameters. * @syscap SystemCapability.HiviewDFX.HiLog * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 + * @arkts 1.2 */ - function warn(domain: int, tag: string, format: string, ...args: (Object | undefined | null)[]): void; + function warn(domain: int, tag: string, format: string, ...args: RecordData[]): void; /** * Outputs error-level logs. @@ -238,6 +245,8 @@ declare namespace hilog { * @atomicservice * @since 11 */ + function error(domain: number, tag: string, format: string, ...args: any[]): void; + /** * Outputs error-level logs. * @@ -245,14 +254,14 @@ declare namespace hilog { * if the value exceeds the range, logs cannot be printed. * @param { string } tag Identifies the log tag, length cannot exceed 32 bytes, the excess part will be truncated. * @param { string } format Indicates the log format string. - * @param { (Object | undefined | null)[] }args Indicates the log parameters. + * @param { RecordData[] }args Indicates the log parameters. * @syscap SystemCapability.HiviewDFX.HiLog * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 + * @arkts 1.2 */ - function error(domain: int, tag: string, format: string, ...args: (Object | undefined | null)[]): void; + function error(domain: int, tag: string, format: string, ...args: RecordData[]): void; /** * Outputs fatal-level logs. @@ -290,6 +299,8 @@ declare namespace hilog { * @atomicservice * @since 11 */ + function fatal(domain: number, tag: string, format: string, ...args: any[]): void; + /** * Outputs fatal-level logs. * @@ -297,14 +308,14 @@ declare namespace hilog { * if the value exceeds the range, logs cannot be printed. * @param { string } tag Identifies the log tag, length cannot exceed 32 bytes, the excess part will be truncated. * @param { string } format Indicates the log format string. - * @param { (Object | undefined | null)[] }args Indicates the log parameters. + * @param { RecordData[] }args Indicates the log parameters. * @syscap SystemCapability.HiviewDFX.HiLog * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 + * @arkts 1.2 */ - function fatal(domain: int, tag: string, format: string, ...args: (Object | undefined | null)[]): void; + function fatal(domain: int, tag: string, format: string, ...args: RecordData[]): void; /** * Checks whether logs of the specified tag, and level can be printed. -- Gitee