Skip to content

Commit ccc8ba4

Browse files
committed
Create logcat_log.json
Add a new format to support Android Logcat (`adb logcat`) output.
1 parent 03ac257 commit ccc8ba4

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

src/formats/formats.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
FORMAT_FILES = \
33
$(srcdir)/%reldir%/access_log.json \
44
$(srcdir)/%reldir%/alb_log.json \
5+
$(srcdir)/%reldir%/android_logcat_log.json \
56
$(srcdir)/%reldir%/block_log.json \
67
$(srcdir)/%reldir%/bunyan_log.json \
78
$(srcdir)/%reldir%/caddy_log.json \

src/formats/logcat_log.json

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"$schema": "https://lnav.org/schemas/format-v1.schema.json",
3+
"logcat_log": {
4+
"description": "Format for Android Logcat tested with the following formats verbs and adverbs: time,threadtime,usec,uid.",
5+
"regex": {
6+
"full": {
7+
"pattern": "(?<time>\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3,})\\s+((?<uid>\\w+)\\s+)?(?<pid>\\d+)\\s+(?<tid>\\d+) (?<level>.) ((?<tag>\\w+)\\s*:)?(?<body>.*)"
8+
},
9+
"brieftime": {
10+
"pattern": "^(?<time>\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3,}) (?<level>.)\\/(?<tag>\\w+)\\s*\\(\\s*(?<uid>\\d+)\\):(?<body>.*)$"
11+
}
12+
},
13+
"partitions": {
14+
"section ": {
15+
"pattern": "^-+ switch to (.*)"
16+
}
17+
},
18+
"ordered-by-time": true,
19+
"timestamp-field": "time",
20+
"timestamp-format": [
21+
"%m-%d %H:%M:%S.%L",
22+
"%m-%d %H:%M:%S.%f"
23+
],
24+
"body-field": "body",
25+
"level-field": "level",
26+
"level": {
27+
"fatal": "^F",
28+
"error": "^E",
29+
"warning": "^W",
30+
"info": "^I",
31+
"debug5": "^D",
32+
"debug2": "^V"
33+
},
34+
"value": {
35+
"level": {
36+
"kind": "string"
37+
},
38+
"tag": {
39+
"kind": "string",
40+
"identifier": false
41+
},
42+
"time": {
43+
"kind": "string"
44+
},
45+
"body": {
46+
"kind": "string"
47+
},
48+
"uid": {
49+
"kind": "string",
50+
"identifier": true
51+
},
52+
"pid": {
53+
"kind": "integer",
54+
"identifier": true
55+
},
56+
"tid": {
57+
"kind": "integer",
58+
"identifier": true
59+
}
60+
},
61+
"highlights": {
62+
"package": {
63+
"pattern": "((([a-z]+\\.){2,})[a-z]+)(?=[ '\"])",
64+
"color": "#97d1F6"
65+
}
66+
},
67+
"sample": [
68+
{
69+
"line": "05-26 11:18:41.509 1000 23402 23402 V VirtualCameraSession: processCaptureRequest: CaptureRequest { frameNumber:102 } ",
70+
"level": "debug2"
71+
},
72+
{
73+
"line": "05-21 15:05:52.808 1047 1116 1240 E FMQ : MQDescriptor is invalid or queue size is 0.",
74+
"level": "error"
75+
},
76+
{
77+
"line": "05-21 20:54:20.971 root 1215 1215 W [18:54:20.964683][dhd][wlan]dhd_dbg_verboselog_printf: Log print water mark is reached, console logs are dumped only to debug_dump file",
78+
"level": "warning"
79+
},
80+
{
81+
"line": "05-26 14:57:03.870 V/Configuration( 1766): Updating configuration, locales updated from [] to [en_US]",
82+
"level": "debug2"
83+
},
84+
{
85+
"line": "06-06 14:26:44.749 13850 13850 D ScreenSharingSample: MediaProjection.Callback#onStop() called",
86+
"level": "debug5"
87+
}
88+
]
89+
}
90+
}

0 commit comments

Comments
 (0)