From e2e6a50b2c5dff2d77ce37840f9553df89e92dea Mon Sep 17 00:00:00 2001 From: liuyifei Date: Sat, 26 Jul 2025 12:21:25 +0800 Subject: [PATCH] update hilog ani Signed-off-by: liuyifei --- interfaces/ets/ani/hilog/ets/@ohos.hilog.ets | 22 +++++++++---------- .../ets/ani/hilog/include/hilog_ani_base.h | 14 ++++++------ .../ets/ani/hilog/src/hilog_ani_base.cpp | 14 ++++++------ 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/interfaces/ets/ani/hilog/ets/@ohos.hilog.ets b/interfaces/ets/ani/hilog/ets/@ohos.hilog.ets index eb237b6..f6bcbce 100644 --- a/interfaces/ets/ani/hilog/ets/@ohos.hilog.ets +++ b/interfaces/ets/ani/hilog/ets/@ohos.hilog.ets @@ -16,22 +16,22 @@ export default namespace hilog { loadLibrary("hilog_ani"); - export native function debug(domain: number, tag: string, format: string, - ...args: (int|boolean|number|string|bigint|Object|undefined|null)[]): void; + export native function debug(domain: int, tag: string, format: string, + ...args: (Object|undefined|null)[]): void; - export native function info(domain: number, tag: string, format: string, - ...args: (int|boolean|number|string|bigint|Object|undefined|null)[]): void; + export native function info(domain: int, tag: string, format: string, + ...args: (Object|undefined|null)[]): void; - export native function warn(domain: number, tag: string, format: string, - ...args: (int|boolean|number|string|bigint|Object|undefined|null)[]): void; + export native function warn(domain: int, tag: string, format: string, + ...args: (Object|undefined|null)[]): void; - export native function error(domain: number, tag: string, format: string, - ...args: (int|boolean|number|string|bigint|Object|undefined|null)[]): void; + export native function error(domain: int, tag: string, format: string, + ...args: (Object|undefined|null)[]): void; - export native function fatal(domain: number, tag: string, format: string, - ...args: (int|boolean|number|string|bigint|Object|undefined|null)[]): void; + export native function fatal(domain: int, tag: string, format: string, + ...args: (Object|undefined|null)[]): void; - export native function isLoggable(domain: number, tag: string, level: LogLevel): boolean; + export native function isLoggable(domain: int, tag: string, level: LogLevel): boolean; export native function setMinLogLevel(level: LogLevel): void; diff --git a/interfaces/ets/ani/hilog/include/hilog_ani_base.h b/interfaces/ets/ani/hilog/include/hilog_ani_base.h index 89445c6..1c7a676 100644 --- a/interfaces/ets/ani/hilog/include/hilog_ani_base.h +++ b/interfaces/ets/ani/hilog/include/hilog_ani_base.h @@ -33,14 +33,14 @@ typedef struct { class HilogAniBase { public: - static void Debug(ani_env *env, ani_double domain, ani_string tag, ani_string format, ani_array args); - static void HilogImpl(ani_env *env, ani_double domain, ani_string tag, ani_string format, ani_array args, + static void Debug(ani_env *env, ani_int domain, ani_string tag, ani_string format, ani_array args); + static void HilogImpl(ani_env *env, ani_int domain, ani_string tag, ani_string format, ani_array args, int level, bool isAppLog); - static void Info(ani_env *env, ani_double domain, ani_string tag, ani_string format, ani_array args); - static void Warn(ani_env *env, ani_double domain, ani_string tag, ani_string format, ani_array args); - static void Error(ani_env *env, ani_double domain, ani_string tag, ani_string format, ani_array args); - static void Fatal(ani_env *env, ani_double domain, ani_string tag, ani_string format, ani_array args); - static ani_boolean IsLoggable(ani_env *env, ani_double domain, ani_string tag, ani_enum_item level); + static void Info(ani_env *env, ani_int domain, ani_string tag, ani_string format, ani_array args); + static void Warn(ani_env *env, ani_int domain, ani_string tag, ani_string format, ani_array args); + static void Error(ani_env *env, ani_int domain, ani_string tag, ani_string format, ani_array args); + static void Fatal(ani_env *env, ani_int domain, ani_string tag, ani_string format, ani_array args); + static ani_boolean IsLoggable(ani_env *env, ani_int domain, ani_string tag, ani_enum_item level); static void SetMinLogLevel(ani_env *env, ani_enum_item level); private: diff --git a/interfaces/ets/ani/hilog/src/hilog_ani_base.cpp b/interfaces/ets/ani/hilog/src/hilog_ani_base.cpp index e473023..bd5ef6f 100644 --- a/interfaces/ets/ani/hilog/src/hilog_ani_base.cpp +++ b/interfaces/ets/ani/hilog/src/hilog_ani_base.cpp @@ -130,7 +130,7 @@ void ParseLogContent(std::string& formatStr, std::vector& params, std: return; } -void HilogAniBase::HilogImpl(ani_env *env, ani_double domain, ani_string tag, +void HilogAniBase::HilogImpl(ani_env *env, ani_int domain, ani_string tag, ani_string format, ani_array args, int level, bool isAppLog) { int32_t domainVal = static_cast(domain); @@ -180,37 +180,37 @@ void HilogAniBase::parseAniValue(ani_env *env, ani_ref element, std::vector(domain); -- Gitee