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)
|
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 .)
|
include_directories(SYSTEM .)
|
||||||
add_executable(lnav ${lnav_SRCS} ${diag_STAT_SRCS})
|
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]) {
|
switch (src[lpc]) {
|
||||||
case '/':
|
case '/':
|
||||||
case '~':
|
case '~':
|
||||||
|
case '#':
|
||||||
if (retval < dst_len) {
|
if (retval < dst_len) {
|
||||||
dst[retval] = '~';
|
dst[retval] = '~';
|
||||||
retval += 1;
|
retval += 1;
|
||||||
if (src[lpc] == '~') {
|
if (src[lpc] == '~') {
|
||||||
dst[retval] = '0';
|
dst[retval] = '0';
|
||||||
}
|
}
|
||||||
|
else if (src[lpc] == '#') {
|
||||||
|
dst[retval] = '2';
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
dst[retval] = '1';
|
dst[retval] = '1';
|
||||||
}
|
}
|
||||||
@ -234,6 +238,10 @@ size_t json_ptr::decode(char *dst, const char *src, ssize_t src_len)
|
|||||||
dst[retval++] = '/';
|
dst[retval++] = '/';
|
||||||
lpc += 1;
|
lpc += 1;
|
||||||
break;
|
break;
|
||||||
|
case '2':
|
||||||
|
dst[retval++] = '#';
|
||||||
|
lpc += 1;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -208,6 +208,10 @@ int yajlpp_parse_context::map_key(void *ctx,
|
|||||||
ypc->ypc_path.push_back('~');
|
ypc->ypc_path.push_back('~');
|
||||||
ypc->ypc_path.push_back('1');
|
ypc->ypc_path.push_back('1');
|
||||||
break;
|
break;
|
||||||
|
case '#':
|
||||||
|
ypc->ypc_path.push_back('~');
|
||||||
|
ypc->ypc_path.push_back('2');
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ypc->ypc_path.push_back(key[lpc]);
|
ypc->ypc_path.push_back(key[lpc]);
|
||||||
break;
|
break;
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
"@fields/user" : {
|
"@fields/user" : {
|
||||||
"kind" : "string",
|
"kind" : "string",
|
||||||
"identifier" : true
|
"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": "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": "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": "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
|
2013-09-06T22:01:49.124 CRITICAL sooo bad
|
||||||
@fields: { "lvl": "CRITICAL", "msg": "sooo bad"}
|
@fields: { "lvl": "CRITICAL", "msg": "sooo bad"}
|
||||||
2013-09-06T22:01:49.124 FATAL shoot
|
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
|
EOF
|
||||||
|
|
||||||
|
|
||||||
@ -456,20 +458,20 @@ run_test ${lnav_test} -n \
|
|||||||
${test_dir}/logfile_nested_json.json
|
${test_dir}/logfile_nested_json.json
|
||||||
|
|
||||||
check_output "log levels not working" <<EOF
|
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
|
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>
|
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>
|
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>,[],steve@example.com
|
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>
|
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>
|
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>
|
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>
|
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>
|
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>
|
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>
|
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>
|
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>
|
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>,[],<NULL>
|
25,<NULL>,2013-09-06 22:01:49.124,0,fatal,0,<NULL>,<NULL>,[],line:1,<NULL>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user