mirror of https://github.com/tstack/lnav.git
[log_formats] change "no patterns have a capture" error to a warning
This commit is contained in:
parent
132bd0adba
commit
af5213a98a
7
NEWS
7
NEWS
|
@ -4,6 +4,13 @@ lnav v0.11.1:
|
|||
instead of an empty string for the `capture_name` column if
|
||||
the capture is not named.
|
||||
|
||||
Fixes:
|
||||
* Reduce the "no patterns have a capture" error to a warning
|
||||
so that it doesn't block lnav from starting up.
|
||||
|
||||
Cost of Doing Business:
|
||||
* Migrated from pcre to pcre2.
|
||||
|
||||
lnav v0.11.0:
|
||||
Features:
|
||||
* Redesigned the top status area to allow for user-specified
|
||||
|
|
17
src/lnav.cc
17
src/lnav.cc
|
@ -2312,8 +2312,9 @@ SELECT tbl_name FROM sqlite_master WHERE sql LIKE 'CREATE VIRTUAL TABLE%'
|
|||
|
||||
load_config(lnav_data.ld_config_paths, config_errors);
|
||||
if (!config_errors.empty()) {
|
||||
print_user_msgs(config_errors);
|
||||
return EXIT_FAILURE;
|
||||
if (print_user_msgs(config_errors) != EXIT_SUCCESS) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
add_global_vars(ec);
|
||||
|
||||
|
@ -2420,8 +2421,9 @@ SELECT tbl_name FROM sqlite_master WHERE sql LIKE 'CREATE VIRTUAL TABLE%'
|
|||
auto format_list = load_format_file(src_path, loader_errors);
|
||||
|
||||
if (!loader_errors.empty()) {
|
||||
print_user_msgs(loader_errors);
|
||||
return EXIT_FAILURE;
|
||||
if (print_user_msgs(loader_errors) != EXIT_SUCCESS) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
if (format_list.empty()) {
|
||||
lnav::console::print(
|
||||
|
@ -2611,9 +2613,10 @@ SELECT tbl_name FROM sqlite_master WHERE sql LIKE 'CREATE VIRTUAL TABLE%'
|
|||
load_format_vtabs(lnav_data.ld_vtab_manager.get(), loader_errors);
|
||||
|
||||
if (!loader_errors.empty()) {
|
||||
print_user_msgs(loader_errors);
|
||||
if (mmode_ops == nullptr) {
|
||||
return EXIT_FAILURE;
|
||||
if (print_user_msgs(loader_errors) != EXIT_SUCCESS) {
|
||||
if (mmode_ops == nullptr) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1932,7 +1932,7 @@ external_log_format::build(std::vector<lnav::console::user_message>& errors)
|
|||
VC_ROLE.value(role_t::VCR_SYMBOL),
|
||||
", ");
|
||||
errors.emplace_back(
|
||||
lnav::console::user_message::error(
|
||||
lnav::console::user_message::warning(
|
||||
attr_line_t("invalid value ")
|
||||
.append_quoted(lnav::roles::symbol(
|
||||
fmt::format(FMT_STRING("/{}/value/{}"),
|
||||
|
|
|
@ -111,12 +111,12 @@
|
|||
[1mstd [0m = “[1m[36m^[0m[1m[32m([0m[1m[32m?[0m[1m[36m<[0mtimestamp>[1m\d[0m[1m[36m+[0m[1m[32m)[0m: [1m[32m([0m[1m[32m?[0m[1m[36m<[0mpid>[1m\w[0m[1m[36m+[0m[1m[32m)[0m [1m[32m([0m[1m[32m?[0m[1m[36m<[0mbody>[1m[36m.[0m[1m[36m*[0m[1m[32m)[0m[1m[36m$[0m”
|
||||
[1mwith-level[0m = “[1m[36m^[0m[1m[32m([0m[1m[32m?[0m[1m[36m<[0mtimestamp>[1m\d[0m[1m[36m+[0m[1m[32m)[0m\| [1m[32m([0m[1m[32m?[0m[1m[36m<[0mlevel>[1m\w[0m[1m[36m+[0m[1m[32m)[0m [1m[32m([0m[1m[32m?[0m[1m[36m<[0mbody>[1m\w[0m[1m[36m+[0m[1m[32m)[0m[1m[36m$[0m”
|
||||
|
||||
[1m[31m✘ error[0m: invalid value “[1m/invalid_props_log/value/non-existent[0m”
|
||||
[1m[31mreason[0m: no patterns have a capture named “non-existent”
|
||||
[33m⚠ warning[0m: invalid value “[1m/invalid_props_log/value/non-existent[0m”
|
||||
[33mreason[0m: no patterns have a capture named “non-existent”
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:4
|
||||
[36m =[0m [36mnote[0m: the following captures are available:
|
||||
[1mbody[0m, [1mpid[0m, [1mtimestamp[0m
|
||||
[36m =[0m [36mhelp[0m: values are populated from captures in patterns, so at least one pattern must have a capture with this value name
|
||||
[36m =[0m [36mnote[0m: the following captures are available:
|
||||
[1mbody[0m, [1mpid[0m, [1mtimestamp[0m
|
||||
[36m =[0m [36mhelp[0m: values are populated from captures in patterns, so at least one pattern must have a capture with this value name
|
||||
[1m[31m✘ error[0m: invalid tag definition “[1m/invalid_props_log/tags/badtag[0m”
|
||||
[1m[31mreason[0m: tag definitions must have a non-empty pattern
|
||||
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:4
|
||||
|
|
Loading…
Reference in New Issue