mirror of
https://github.com/tstack/lnav.git
synced 2024-10-26 13:16:11 +03:00
actual fix for json fields
This commit is contained in:
parent
a758056657
commit
d8a49ec737
@ -365,7 +365,8 @@ static int read_json_null(yajlpp_parse_context *ypc)
|
||||
json_log_userdata *jlu = (json_log_userdata *)ypc->ypc_userdata;
|
||||
const intern_string_t field_name = ypc->get_path();
|
||||
|
||||
jlu->jlu_sub_line_count += jlu->jlu_format->value_line_count(field_name);
|
||||
jlu->jlu_sub_line_count += jlu->jlu_format->value_line_count(
|
||||
field_name, ypc->is_level(1));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -375,7 +376,8 @@ static int read_json_bool(yajlpp_parse_context *ypc, int val)
|
||||
json_log_userdata *jlu = (json_log_userdata *)ypc->ypc_userdata;
|
||||
const intern_string_t field_name = ypc->get_path();
|
||||
|
||||
jlu->jlu_sub_line_count += jlu->jlu_format->value_line_count(field_name);
|
||||
jlu->jlu_sub_line_count += jlu->jlu_format->value_line_count(
|
||||
field_name, ypc->is_level(1));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -406,7 +408,8 @@ static int read_json_int(yajlpp_parse_context *ypc, long long val)
|
||||
}
|
||||
}
|
||||
|
||||
jlu->jlu_sub_line_count += jlu->jlu_format->value_line_count(field_name);
|
||||
jlu->jlu_sub_line_count += jlu->jlu_format->value_line_count(
|
||||
field_name, ypc->is_level(1));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -425,7 +428,8 @@ static int read_json_double(yajlpp_parse_context *ypc, double val)
|
||||
jlu->jlu_base_line->set_time(tv);
|
||||
}
|
||||
|
||||
jlu->jlu_sub_line_count += jlu->jlu_format->value_line_count(field_name);
|
||||
jlu->jlu_sub_line_count += jlu->jlu_format->value_line_count(
|
||||
field_name, ypc->is_level(1));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -939,7 +943,8 @@ static int read_json_field(yajlpp_parse_context *ypc, const unsigned char *str,
|
||||
jlu->jlu_base_line->set_opid(opid);
|
||||
}
|
||||
|
||||
jlu->jlu_sub_line_count += jlu->jlu_format->value_line_count(field_name, str, len);
|
||||
jlu->jlu_sub_line_count += jlu->jlu_format->value_line_count(
|
||||
field_name, ypc->is_level(1), str, len);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -1041,6 +1041,7 @@ public:
|
||||
};
|
||||
|
||||
long value_line_count(const intern_string_t ist,
|
||||
bool top_level,
|
||||
const unsigned char *str = NULL,
|
||||
ssize_t len = -1) const {
|
||||
std::map<const intern_string_t, value_def>::const_iterator iter =
|
||||
@ -1048,7 +1049,7 @@ public:
|
||||
long line_count = (str != NULL) ? std::count(&str[0], &str[len], '\n') + 1 : 1;
|
||||
|
||||
if (iter == this->elf_value_defs.end()) {
|
||||
return this->jlf_hide_extra ? 0 : line_count;
|
||||
return (this->jlf_hide_extra || !top_level) ? 0 : line_count;
|
||||
}
|
||||
|
||||
if (iter->second.vd_hidden) {
|
||||
|
Loading…
Reference in New Issue
Block a user