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()),