]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
trace_log: include the "[group]" tag in the messages
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 4 Aug 2021 09:40:30 +0000 (11:40 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 10 Aug 2021 18:16:58 +0000 (20:16 +0200)
lib/log.c

index 31ca8e9ba692dd70fb97920819eacc6b28309235..76b4cf0382f43b49069c75dec182d9f6b774113e 100644 (file)
--- a/lib/log.c
+++ b/lib/log.c
@@ -272,15 +272,15 @@ static void kr_vlog_req(
        struct mempool *mp = mp_new(512);
 
        const uint32_t req_uid = req ? req->uid : 0;
-       char *msg = mp_printf(mp, "[%05u.%02u] %*s",
-                               req_uid, qry_uid, indent, "");
+       char *msg = mp_printf(mp, "[%-6s][%05u.%02u] %*s",
+                               tag, req_uid, qry_uid, indent, "");
 
        msg = mp_vprintf_append(mp, msg, fmt, args);
 
        if (req_has_trace_log(req))
                req->trace_log(req, msg);
 
-       kr_log_fmt(group, LOG_DEBUG, SD_JOURNAL_METADATA, "[%-6s]%s", tag, msg);
+       kr_log_fmt(group, LOG_DEBUG, SD_JOURNAL_METADATA, "%s", msg);
 
        mp_delete(mp);
 }