From 9f46351f7787f7d33325f13079911bc9163ba7cd Mon Sep 17 00:00:00 2001 From: Sean Date: Tue, 27 Aug 2024 16:19:05 +0800 Subject: [PATCH] fix "str is [], can't find level" error --- src/conf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/conf.c b/src/conf.c index f251e88..83b1620 100644 --- a/src/conf.c +++ b/src/conf.c @@ -567,7 +567,9 @@ static int zlog_conf_build_with_file(zlog_conf_t * a_conf) } } - a_conf->level = zlog_level_list_atoi(a_conf->levels, a_conf->log_level); + if (a_conf->log_level[0] != '\0') { + a_conf->level = zlog_level_list_atoi(a_conf->levels, a_conf->log_level); + } exit: fclose(fp);