From 514b27fe187552eea7af75a27a5398c1ea009bcf Mon Sep 17 00:00:00 2001 From: mpeter50 <83356418+mpeter50@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:54:07 +0200 Subject: [PATCH] convert comments to C-style comments --- src/formats/gitea_log.json | 4 ++-- src/formats/i2p_router_log.json | 31 ++++++++++++------------------- src/formats/logcat.json | 5 ++--- src/formats/virtiofsd.json | 4 ++-- 4 files changed, 18 insertions(+), 26 deletions(-) diff --git a/src/formats/gitea_log.json b/src/formats/gitea_log.json index 1982da3075..9d1d720b11 100644 --- a/src/formats/gitea_log.json +++ b/src/formats/gitea_log.json @@ -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 } ] } diff --git a/src/formats/i2p_router_log.json b/src/formats/i2p_router_log.json index 297ac930d9..0e0fd7f1ba 100644 --- a/src/formats/i2p_router_log.json +++ b/src/formats/i2p_router_log.json @@ -7,21 +7,14 @@ "multiline": true, "regex": { "std": { - "pattern": "^(?J:(?:(?\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?:(?[A-Z]+) \\[(?[\\w \\/]+)\\] (?[\\w.]+): (?.*)|(?:(?:\\^){3} \\d+ similar messages omitted (?:\\^){3})))|(?:(?:(?:[\\w.]+(?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": "^(?\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?[A-Z]+) \\[(?[\\w \\\/]+)\\] (?[\\w.]+): (?.*)$", - "variant_omit": "^(?\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?:\\^){3} \\d+ similar messages omitted (?:\\^){3}$", - "variant_exception": "^(?:(?:(?:[\\w.]+(?Exception):)|(?:\\\\0009at)) .*)$" - } - }, - "teszt": { - "pattern": "(Exception)|(\\s+handler 1/1)|(\\sat [\\w.]+)|(similar messages omitted)", - "module-format": true + "pattern": "^(?J:(?:(?\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?:(?[A-Z]+) \\[(?[\\w \\/]+)\\] (?[\\w.]+): (?.*)|(?:(?:\\^){3} \\d+ similar messages omitted (?:\\^){3})))|(?:(?:(?:[\\w.]+(?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": "^(?\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?[A-Z]+) \\[(?[\\w \\\/]+)\\] (?[\\w.]+): (?.*)$" + // "variant_omit": "^(?\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?:\\^){3} \\d+ similar messages omitted (?:\\^){3}$" + // "variant_exception": "^(?:(?:(?:[\\w.]+(?Exception):)|(?:\\\\0009at)) .*)$" } }, "value": { @@ -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" diff --git a/src/formats/logcat.json b/src/formats/logcat.json index 7c4c23d8f3..3532d4ba6f 100644 --- a/src/formats/logcat.json +++ b/src/formats/logcat.json @@ -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" : "^(?\\d{2}-\\d{2}\\s+\\d{2}:\\d{2}:\\d{2}.\\d{3})\\s+(?\\d+)\\s+(?\\d+)\\s+(?\\w)\\s+(?:\\[@@\\s+\\]\\s)?(?.*)(?:\\s+)?:\\s+(?.*)$", - "comment:": "threadtime is a format accepted by the `logcat -v ` command" + "logcat_format_threadtime" : { // threadtime is a format accepted by the `logcat -v ` command + "pattern" : "^(?\\d{2}-\\d{2}\\s+\\d{2}:\\d{2}:\\d{2}.\\d{3})\\s+(?\\d+)\\s+(?\\d+)\\s+(?\\w)\\s+(?:\\[@@\\s+\\]\\s)?(?.*)(?:\\s+)?:\\s+(?.*)$" } }, "timestamp-format" : ["%m-%d %H:%M:%S.%L"], diff --git a/src/formats/virtiofsd.json b/src/formats/virtiofsd.json index aeaa86a273..418e584387 100644 --- a/src/formats/virtiofsd.json +++ b/src/formats/virtiofsd.json @@ -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 } ] }