From 2669120afebcba746f638f4d3c6c446a9c1d06cd Mon Sep 17 00:00:00 2001 From: YuanSheng Wang Date: Wed, 19 Feb 2020 21:03:00 +0800 Subject: [PATCH] opt: print warning error message if the yaml route file is invalid. (#1141) --- .gitignore | 1 + lua/apisix/debug.lua | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3255856b1274..f3c389a21ec8 100644 --- a/.gitignore +++ b/.gitignore @@ -56,6 +56,7 @@ utils/lj-releng .idea/ *.iml dashboard/ +\.* # .travis !.travis/*.sh diff --git a/lua/apisix/debug.lua b/lua/apisix/debug.lua index 66ae94cc0df6..7f458fed7e6a 100644 --- a/lua/apisix/debug.lua +++ b/lua/apisix/debug.lua @@ -70,8 +70,13 @@ local function read_debug_yaml() end if not found_end_flag then + f:seek("set") + local size = f:seek("end") f:close() - log.notice("missing valid end flag in file ", debug_yaml_path) + + if size > 8 then + log.warn("missing valid end flag in file ", debug_yaml_path) + end return end