加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0054-PRE_LOG-modify-log-info-while-there-are-repeated-ite.patch 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
yinbin6 提交于 2023-11-29 15:01 . sync support vlan offload
From 38ce070bc6922470a92b925e030ba61586a6e92a Mon Sep 17 00:00:00 2001
From: yinbin <yinbin8@huawei.com>
Date: Mon, 20 Nov 2023 11:08:10 +0800
Subject: [PATCH] PRE_LOG: modify log info while there are repeated items in
conf file
---
src/lstack/core/lstack_cfg.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/lstack/core/lstack_cfg.c b/src/lstack/core/lstack_cfg.c
index 9f3143f..7a4504f 100644
--- a/src/lstack/core/lstack_cfg.c
+++ b/src/lstack/core/lstack_cfg.c
@@ -946,6 +946,7 @@ static int32_t parse_conf_file(const char *path)
int32_t ret;
if (realpath(path, real_path) == NULL) {
+ LSTACK_PRE_LOG(LSTACK_ERR, "Config path error. Errno: %d. Please check conf file path: %s\n", errno, path);
return -1;
}
@@ -953,7 +954,7 @@ static int32_t parse_conf_file(const char *path)
ret = config_read_file(&g_config, real_path);
if (ret == 0) {
- LSTACK_PRE_LOG(LSTACK_ERR, "Config file path error, Please check conf file path.\n");
+ LSTACK_PRE_LOG(LSTACK_ERR, "Read config file \"%s\" error: %s\n", real_path, config_error_text(&g_config));
config_destroy(&g_config);
return -EINVAL;
}
@@ -961,7 +962,7 @@ static int32_t parse_conf_file(const char *path)
for (int32_t i = 0; g_config_tbl[i].name && g_config_tbl[i].f; ++i) {
ret = g_config_tbl[i].f();
if (ret != 0) {
- LSTACK_PRE_LOG(LSTACK_ERR, "error parsing parameter '%s' ret=%d\n.", g_config_tbl[i].name, ret);
+ LSTACK_PRE_LOG(LSTACK_ERR, "error parsing parameter '%s' ret=%d.\n", g_config_tbl[i].name, ret);
config_destroy(&g_config);
return ret;
}
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化