mirror of
https://github.com/tstack/lnav.git
synced 2024-08-17 00:40:30 +03:00
parent
832f980ab9
commit
5e8a1cebe9
@ -190,6 +190,10 @@ set(diag_STAT_SRCS
|
||||
|
||||
set(lnav_SRCS lnav.cc)
|
||||
|
||||
include_directories(../../lbuild-debug/src /opt/local/include)
|
||||
include_directories(
|
||||
../../lbuild-debug/src
|
||||
/opt/local/include
|
||||
/usr/local/opt/sqlite3/include
|
||||
)
|
||||
include_directories(SYSTEM .)
|
||||
add_executable(lnav ${lnav_SRCS} ${diag_STAT_SRCS})
|
||||
|
@ -187,12 +187,16 @@ json_ptr::encode(char *dst, size_t dst_len, const char *src, size_t src_len)
|
||||
switch (src[lpc]) {
|
||||
case '/':
|
||||
case '~':
|
||||
case '#':
|
||||
if (retval < dst_len) {
|
||||
dst[retval] = '~';
|
||||
retval += 1;
|
||||
if (src[lpc] == '~') {
|
||||
dst[retval] = '0';
|
||||
}
|
||||
else if (src[lpc] == '#') {
|
||||
dst[retval] = '2';
|
||||
}
|
||||
else {
|
||||
dst[retval] = '1';
|
||||
}
|
||||
@ -234,6 +238,10 @@ size_t json_ptr::decode(char *dst, const char *src, ssize_t src_len)
|
||||
dst[retval++] = '/';
|
||||
lpc += 1;
|
||||
break;
|
||||
case '2':
|
||||
dst[retval++] = '#';
|
||||
lpc += 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -208,6 +208,10 @@ int yajlpp_parse_context::map_key(void *ctx,
|
||||
ypc->ypc_path.push_back('~');
|
||||
ypc->ypc_path.push_back('1');
|
||||
break;
|
||||
case '#':
|
||||
ypc->ypc_path.push_back('~');
|
||||
ypc->ypc_path.push_back('2');
|
||||
break;
|
||||
default:
|
||||
ypc->ypc_path.push_back(key[lpc]);
|
||||
break;
|
||||
|
@ -18,6 +18,9 @@
|
||||
"@fields/user" : {
|
||||
"kind" : "string",
|
||||
"identifier" : true
|
||||
},
|
||||
"@fields/trace#" : {
|
||||
"kind" : "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,4 +10,4 @@
|
||||
{"ts": "2013-09-06T22:01:49.124817Z", "@fields": { "lvl": "WARNING", "msg": "not looking good"}}
|
||||
{"ts": "2013-09-06T22:01:49.124817Z", "@fields": { "lvl": "ERROR", "msg": "looking bad"}}
|
||||
{"ts": "2013-09-06T22:01:49.124817Z", "@fields": { "lvl": "CRITICAL", "msg": "sooo bad"}}
|
||||
{"ts": "2013-09-06T22:01:49.124817Z", "@fields": { "lvl": "FATAL", "msg": "shoot"}}
|
||||
{"ts": "2013-09-06T22:01:49.124817Z", "@fields": { "lvl": "FATAL", "msg": "shoot", "trace": ["line:1", "line:2"]}}
|
||||
|
@ -445,7 +445,9 @@ check_output "json log format is not working" <<EOF
|
||||
2013-09-06T22:01:49.124 CRITICAL sooo bad
|
||||
@fields: { "lvl": "CRITICAL", "msg": "sooo bad"}
|
||||
2013-09-06T22:01:49.124 FATAL shoot
|
||||
@fields: { "lvl": "FATAL", "msg": "shoot"}
|
||||
@fields/trace#: line:1
|
||||
@fields/trace#: line:2
|
||||
@fields: { "lvl": "FATAL", "msg": "shoot", "trace": ["line:1", "line:2"]}
|
||||
EOF
|
||||
|
||||
|
||||
@ -456,20 +458,20 @@ run_test ${lnav_test} -n \
|
||||
${test_dir}/logfile_nested_json.json
|
||||
|
||||
check_output "log levels not working" <<EOF
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_filters,@fields/user
|
||||
0,<NULL>,2013-09-06 20:00:48.124,0,trace,0,<NULL>,<NULL>,[],<NULL>
|
||||
2,<NULL>,2013-09-06 20:00:49.124,1000,info,0,<NULL>,<NULL>,[],<NULL>
|
||||
4,<NULL>,2013-09-06 22:00:49.124,7200000,info,0,<NULL>,<NULL>,[],steve@example.com
|
||||
7,<NULL>,2013-09-06 22:00:59.124,10000,debug5,0,<NULL>,<NULL>,[],<NULL>
|
||||
9,<NULL>,2013-09-06 22:00:59.124,0,debug4,0,<NULL>,<NULL>,[],<NULL>
|
||||
11,<NULL>,2013-09-06 22:00:59.124,0,debug3,0,<NULL>,<NULL>,[],<NULL>
|
||||
13,<NULL>,2013-09-06 22:00:59.124,0,debug2,0,<NULL>,<NULL>,[],<NULL>
|
||||
15,<NULL>,2013-09-06 22:00:59.124,0,debug,0,<NULL>,<NULL>,[],<NULL>
|
||||
17,<NULL>,2013-09-06 22:01:49.124,50000,stats,0,<NULL>,<NULL>,[],<NULL>
|
||||
19,<NULL>,2013-09-06 22:01:49.124,0,warning,0,<NULL>,<NULL>,[],<NULL>
|
||||
21,<NULL>,2013-09-06 22:01:49.124,0,error,0,<NULL>,<NULL>,[],<NULL>
|
||||
23,<NULL>,2013-09-06 22:01:49.124,0,critical,0,<NULL>,<NULL>,[],<NULL>
|
||||
25,<NULL>,2013-09-06 22:01:49.124,0,fatal,0,<NULL>,<NULL>,[],<NULL>
|
||||
log_line,log_part,log_time,log_idle_msecs,log_level,log_mark,log_comment,log_tags,log_filters,@fields/trace#,@fields/user
|
||||
0,<NULL>,2013-09-06 20:00:48.124,0,trace,0,<NULL>,<NULL>,[],<NULL>,<NULL>
|
||||
2,<NULL>,2013-09-06 20:00:49.124,1000,info,0,<NULL>,<NULL>,[],<NULL>,<NULL>
|
||||
4,<NULL>,2013-09-06 22:00:49.124,7200000,info,0,<NULL>,<NULL>,[],<NULL>,steve@example.com
|
||||
7,<NULL>,2013-09-06 22:00:59.124,10000,debug5,0,<NULL>,<NULL>,[],<NULL>,<NULL>
|
||||
9,<NULL>,2013-09-06 22:00:59.124,0,debug4,0,<NULL>,<NULL>,[],<NULL>,<NULL>
|
||||
11,<NULL>,2013-09-06 22:00:59.124,0,debug3,0,<NULL>,<NULL>,[],<NULL>,<NULL>
|
||||
13,<NULL>,2013-09-06 22:00:59.124,0,debug2,0,<NULL>,<NULL>,[],<NULL>,<NULL>
|
||||
15,<NULL>,2013-09-06 22:00:59.124,0,debug,0,<NULL>,<NULL>,[],<NULL>,<NULL>
|
||||
17,<NULL>,2013-09-06 22:01:49.124,50000,stats,0,<NULL>,<NULL>,[],<NULL>,<NULL>
|
||||
19,<NULL>,2013-09-06 22:01:49.124,0,warning,0,<NULL>,<NULL>,[],<NULL>,<NULL>
|
||||
21,<NULL>,2013-09-06 22:01:49.124,0,error,0,<NULL>,<NULL>,[],<NULL>,<NULL>
|
||||
23,<NULL>,2013-09-06 22:01:49.124,0,critical,0,<NULL>,<NULL>,[],<NULL>,<NULL>
|
||||
25,<NULL>,2013-09-06 22:01:49.124,0,fatal,0,<NULL>,<NULL>,[],line:1,<NULL>
|
||||
EOF
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user