From da2ddc74419b591b25c6f5ace92b71281fbe4af8 Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Wed, 23 Apr 2025 15:17:23 +0800 Subject: [PATCH] sf_log_config for client correctly --- src/sf_global.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/sf_global.c b/src/sf_global.c index 6c429ca..c4ca912 100644 --- a/src/sf_global.c +++ b/src/sf_global.c @@ -1028,11 +1028,16 @@ void sf_log_config_ex(const char *other_config) char sz_context_config[128]; sf_global_config_to_string(sz_global_config, sizeof(sz_global_config)); - sf_context_config_to_string(&g_sf_context, - sz_context_config, sizeof(sz_context_config)); - logInfo("%s, %s%s%s", - sz_global_config, sz_context_config, + if (!g_sf_context.is_client) { + sf_context_config_to_string(&g_sf_context, sz_context_config, + sizeof(sz_context_config)); + } else { + *sz_context_config = '\0'; + } + + logInfo("%s%s%s%s%s", sz_global_config, (*sz_context_config != '\0') ? + ", " : "", sz_context_config, (other_config != NULL && *other_config != '\0') ? ", " : "", (other_config != NULL) ? other_config : "" );