Skip to content

Commit

Permalink
convert comments to C-style comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeter50 committed Jul 22, 2024
1 parent 93fa7e5 commit 514b27f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/formats/gitea_log.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
},
{
"line": "^[[36m2023/09/24 22:16:01 ^[[0m^[[32mcmd/web.go:175:^[[32mserveInstalled()^[[0m ^[[1;32m[I]^[[0m PING DATABASE mysql",
"level": "info",
"comment": "log line stored with terminal color codes"
"level": "info"
// log line stored with terminal color codes
}
]
}
Expand Down
31 changes: 12 additions & 19 deletions src/formats/i2p_router_log.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,14 @@
"multiline": true,
"regex": {
"std": {
"pattern": "^(?J:(?:(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?:(?<level>[A-Z]+) \\[(?<module>[\\w \\/]+)\\] (?<component>[\\w.]+): (?<body>.*)|(?:(?:\\^){3} \\d+ similar messages omitted (?:\\^){3})))|(?:(?:(?:[\\w.]+(?<level>Exception):)|(?:\\\\u0009at)) .*))$",
"comments": [
"The I2P router uses several log line variants that largely differ in their formats.",
"editing a variant should be done below in subformats for better readability and understandability,",
"and then merged into the pattern above."
],
"subformats": {
"variant_normal": "^(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?<level>[A-Z]+) \\[(?<module>[\\w \\\/]+)\\] (?<component>[\\w.]+): (?<body>.*)$",
"variant_omit": "^(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?:\\^){3} \\d+ similar messages omitted (?:\\^){3}$",
"variant_exception": "^(?:(?:(?:[\\w.]+(?<level>Exception):)|(?:\\\\0009at)) .*)$"
}
},
"teszt": {
"pattern": "(Exception)|(\\s+handler 1/1)|(\\sat [\\w.]+)|(similar messages omitted)",
"module-format": true
"pattern": "^(?J:(?:(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?:(?<level>[A-Z]+) \\[(?<module>[\\w \\/]+)\\] (?<component>[\\w.]+): (?<body>.*)|(?:(?:\\^){3} \\d+ similar messages omitted (?:\\^){3})))|(?:(?:(?:[\\w.]+(?<level>Exception):)|(?:\\\\u0009at)) .*))$"
// The I2P router uses several log line variants that largely differ in their formats.
// Editing a variant should be done below in subformats for better readability and understandability,
// and then merged into the pattern above.
// subformats:
// "variant_normal": "^(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?<level>[A-Z]+) \\[(?<module>[\\w \\\/]+)\\] (?<component>[\\w.]+): (?<body>.*)$"
// "variant_omit": "^(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?:\\^){3} \\d+ similar messages omitted (?:\\^){3}$"
// "variant_exception": "^(?:(?:(?:[\\w.]+(?<level>Exception):)|(?:\\\\0009at)) .*)$"
}
},
"value": {
Expand All @@ -47,12 +40,12 @@
"level": "warning"
},
{
"line": "2023-10-25 03:33:42.121 ^^^ 2 similar messages omitted ^^^",
"comment": "when lines are repated, the replacmeent line does not have a log level"
"line": "2023-10-25 03:33:42.121 ^^^ 2 similar messages omitted ^^^"
// when lines are repated, the replacmeent line does not have a log level
},
{
"line": "java.io.IOException: Peer is dead: F~UzS1mTN3XYlnOfidMBv5Z4lHI7dsCZ8N5mxpyc-OU=\\n",
"comment": "handle exception lines"
"line": "java.io.IOException: Peer is dead: F~UzS1mTN3XYlnOfidMBv5Z4lHI7dsCZ8N5mxpyc-OU=\\n"
// handle exception lines
},
{
"line": "\\u0009at net.i2p.router.transport.udp.PeerState2.getNextPacketNumber(PeerState2.java:326)\\n"
Expand Down
5 changes: 2 additions & 3 deletions src/formats/logcat.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
"description" : "The system logger format of the Android operating system.",
"url" : "https://developer.android.com/studio/command-line/logcat.html",
"regex" : {
"logcat_format_threadtime" : {
"pattern" : "^(?<timestamp>\\d{2}-\\d{2}\\s+\\d{2}:\\d{2}:\\d{2}.\\d{3})\\s+(?<log_pid>\\d+)\\s+(?<log_tid>\\d+)\\s+(?<level>\\w)\\s+(?:\\[@@\\s+\\]\\s)?(?<log_tag>.*)(?:\\s+)?:\\s+(?<body>.*)$",
"comment:": "threadtime is a format accepted by the `logcat -v <format>` command"
"logcat_format_threadtime" : { // threadtime is a format accepted by the `logcat -v <format>` command
"pattern" : "^(?<timestamp>\\d{2}-\\d{2}\\s+\\d{2}:\\d{2}:\\d{2}.\\d{3})\\s+(?<log_pid>\\d+)\\s+(?<log_tid>\\d+)\\s+(?<level>\\w)\\s+(?:\\[@@\\s+\\]\\s)?(?<log_tag>.*)(?:\\s+)?:\\s+(?<body>.*)$"
}
},
"timestamp-format" : ["%m-%d %H:%M:%S.%L"],
Expand Down
4 changes: 2 additions & 2 deletions src/formats/virtiofsd.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
},
{
"line": "[2024-07-20T14:21:58Z DEBUG virtiofsd::server] Received request: opcode=Lookup (1), inode=1111, unique=2222, pid=3333",
"level": "debug",
"comment": ") at the end of opcode gets dropped by field recognition, but highlights highlight it as expected"
"level": "debug"
// ')' at the end of opcode gets dropped by field recognition, but highlights highlight it as expected
}
]
}
Expand Down

0 comments on commit 514b27f

Please sign in to comment.