From 441a45537425a4a02aa5cae6933d730d4010189b Mon Sep 17 00:00:00 2001 From: liujia178 Date: Sun, 7 Apr 2024 10:43:12 +0800 Subject: [PATCH] Close ld log Issue: https://gitee.com/openharmony/third_party_musl/issues/I9EBMX?from=project-issue Test: libc-test Signed-off-by: liujia178 --- etc/musl.para | 2 +- ldso/linux/ld_log.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/musl.para b/etc/musl.para index d95e23a41..260ed7072 100644 --- a/etc/musl.para +++ b/etc/musl.para @@ -28,4 +28,4 @@ musl.log.enable=false # musl.log.ld.app.your_app_name=false # ================================ -musl.log.ld.all=true \ No newline at end of file +musl.log.ld.all=false \ No newline at end of file diff --git a/ldso/linux/ld_log.h b/ldso/linux/ld_log.h index 47f70587b..641338d1e 100644 --- a/ldso/linux/ld_log.h +++ b/ldso/linux/ld_log.h @@ -37,7 +37,9 @@ hidden void ld_log_reset(); hidden bool is_dlclose_debug_enable(); #if ((LD_LOG_LEVEL & LD_LOG_ERROR) && (defined(OHOS_ENABLE_PARAMETER) || defined(ENABLE_MUSL_LOG))) -#define LD_LOGE(...) (void)HiLogAdapterPrint(MUSL_LOG_TYPE, LOG_ERROR, MUSL_LOG_DOMAIN, LD_LOG_TAG, __VA_ARGS__); +#define LD_LOGE(...) if (get_ld_log_enable()) { \ + (void)HiLogAdapterPrint(MUSL_LOG_TYPE, LOG_ERROR, MUSL_LOG_DOMAIN, LD_LOG_TAG, __VA_ARGS__); \ +} #else #define LD_LOGE(...) #endif -- Gitee