diff --git a/src/log_format.cc b/src/log_format.cc index 70874353..8e604515 100644 --- a/src/log_format.cc +++ b/src/log_format.cc @@ -1342,6 +1342,15 @@ void external_log_format::build(std::vector &errors) { iter->first + "]" + ":" + e.what()); + errors.push_back("error:" + + this->elf_name.to_string() + ".regex[" + + iter->first + "]" + + ":" + pat.p_string); + errors.push_back("error:" + + this->elf_name.to_string() + ".regex[" + + iter->first + "]" + + ":" + string(e.e_offset, ' ') + + "^"); continue; } for (pcre_named_capture::iterator name_iter = pat.p_pcre->named_begin(); diff --git a/src/pcrepp.hh b/src/pcrepp.hh index 9825f8a4..3070e696 100644 --- a/src/pcrepp.hh +++ b/src/pcrepp.hh @@ -528,7 +528,7 @@ public: } while (length > 0); return length; - } + }; #ifdef PCRE_STUDY_JIT_COMPILE static pcre_jit_stack *jit_stack(void); diff --git a/test/test_format_loader.sh b/test/test_format_loader.sh index ccb5323d..87a72eb3 100644 --- a/test/test_format_loader.sh +++ b/test/test_format_loader.sh @@ -10,6 +10,8 @@ sed -i "" -e "s|/.*/init.sql|init.sql|g" `test_err_filename` check_error_output "invalid format not detected?" <\d+: (?.*)$ +error:bad_regex_log.regex[std]: ^ error:bad_regex_log.level:missing ) error:bad_regex_log:invalid sample -- 1428634687123; foo error:bad_sample_log:invalid sample -- 1428634687123; foo bar