From bf05af5140f9bee3643a4107fe5dbfd41321aa10 Mon Sep 17 00:00:00 2001 From: huangxin Date: Mon, 6 Feb 2023 10:13:49 +0800 Subject: [PATCH] =?UTF-8?q?OCT=201.=20=E5=90=AF=E5=8A=A8=E6=97=B6=E5=88=A4?= =?UTF-8?q?=E6=96=ADlog=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=AD=98=E5=9C=A8=EF=BC=8C=E5=B9=B6=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- srcs/libs/init/init_runtime.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/srcs/libs/init/init_runtime.c b/srcs/libs/init/init_runtime.c index ab7eb35..df8e815 100644 --- a/srcs/libs/init/init_runtime.c +++ b/srcs/libs/init/init_runtime.c @@ -76,12 +76,16 @@ int user_init(const char *pAppCfgFile, const char *pCfgDirectory, const char *pK utstring_new(pPath); utstring_printf(pPath, "%s/%s", bufCfgDir, "zlog.conf"); - if ((ret = dzlog_init(utstring_body(pPath), get_cur_process_name())) != ERR_SUCCESS) { - printf("Zlog configure file [%s] init result: %d+++++\n", utstring_body(pPath), ret); - zlog_profile(); - return -ERR_ZLOG_INIT; + if (file_exists(utstring_body(pPath))) { + if ((ret = dzlog_init(utstring_body(pPath), get_cur_process_name())) != ERR_SUCCESS) { + printf("Zlog configure file [%s] init result: %d+++++\n", utstring_body(pPath), ret); + zlog_profile(); + return -ERR_ZLOG_INIT; + } else { + dzlog_info("Zlog used configure file [%s]\n", utstring_body(pPath)); + } } else { - dzlog_info("Zlog used configure file [%s]\n", utstring_body(pPath)); + printf("Zlog configure file [%s] not found, Zlog system not work+++++\n", utstring_body(pPath)); } zlog_level_switch(zlog_get_category(get_cur_process_name()),