Commit d782766d authored by Vladimír Čunát's avatar Vladimír Čunát

logging ID nitpicks

- align the numbers to 5+2 digits (pad with zeros), and use unsigned
- add numbers for the '(NOT) classified as SECURE' message
parent 9c2de036
......@@ -614,7 +614,7 @@ static int stash_rrarray_entry(ranked_rr_array_t *arr, int arr_i,
ssize_t written = stash_rrset(cache, qry, rr, rr_sigs, qry->timestamp.tv_sec,
entry->rank, nsec_pmap, has_optout);
if (written < 0) {
kr_log_error("[%i.%i][cach] stash failed, ret = %d\n", qry->request->uid,
kr_log_error("[%05u.%02u][cach] stash failed, ret = %d\n", qry->request->uid,
qry->uid, ret);
return (int) written;
}
......
......@@ -30,7 +30,7 @@
uint32_t _q_uid = q ? q->uid : 0; \
uint32_t _req_uid = q && q->request ? q->request->uid : 0; \
for (; q; q = q->parent, _ind += 2); \
kr_log_verbose("[%i.%i][%s] %*s" fmt, _req_uid, _q_uid, cls, _ind, "", ## __VA_ARGS__); \
kr_log_verbose("[%05u.%02u][%s] %*s" fmt, _req_uid, _q_uid, cls, _ind, "", ## __VA_ARGS__); \
} \
}
#else
......
......@@ -943,7 +943,7 @@ static int prepare_query(kr_layer_t *ctx, knot_pkt_t *pkt)
WITH_VERBOSE(query) {
KR_DNAME_GET_STR(name_str, query->sname);
KR_RRTYPE_GET_STR(type_str, query->stype);
QVERBOSE_MSG(query, "'%s' type '%s' new uid was assigned %u, parent uid %u\n",
QVERBOSE_MSG(query, "'%s' type '%s' new uid was assigned .%02u, parent uid .%02u\n",
name_str, type_str, req->rplan.next_uid,
query->parent ? query->parent->uid : 0);
}
......
......@@ -668,7 +668,7 @@ static int answer_finalize(struct kr_request *request, int state)
/* No detailed analysis ATM, just _SECURE or not.
* LATER: request->rank might better be computed in validator's finish phase. */
VERBOSE_MSG(NULL, " AD: request%s classified as SECURE\n", secure ? "" : " NOT");
VERBOSE_MSG(last, "AD: request%s classified as SECURE\n", secure ? "" : " NOT");
request->rank = secure ? KR_RANK_SECURE : KR_RANK_INITIAL;
/* Clear AD if not secure. ATM answer has AD=1 if requested secured answer. */
......@@ -1581,7 +1581,7 @@ int kr_resolve_checkout(struct kr_request *request, struct sockaddr *src,
}
inet_ntop(addr->sa_family, kr_inaddr(&qry->ns.addr[i].ip), ns_str, sizeof(ns_str));
VERBOSE_MSG(qry,
"=> id: '%u' querying: '%s' score: %u zone cut: '%s' "
"=> id: '%05u' querying: '%s' score: %u zone cut: '%s' "
"qname: '%s' qtype: '%s' proto: '%s'\n",
qry->id, ns_str, qry->ns.score, zonecut_str,
qname_str, type_str, (qry->flags.TCP) ? "tcp" : "udp");
......
......@@ -207,7 +207,7 @@ struct kr_query *kr_rplan_push_empty(struct kr_rplan *rplan, struct kr_query *pa
}
WITH_VERBOSE(qry) {
VERBOSE_MSG(qry, "plan '%s' type '%s' uid [%i.%i]\n", "", "",
VERBOSE_MSG(qry, "plan '%s' type '%s' uid [%05u.%02u]\n", "", "",
qry->request ? qry->request->uid : 0, qry->uid);
}
return qry;
......@@ -231,7 +231,7 @@ struct kr_query *kr_rplan_push(struct kr_rplan *rplan, struct kr_query *parent,
WITH_VERBOSE(qry) {
KR_DNAME_GET_STR(name_str, name);
KR_RRTYPE_GET_STR(type_str, type);
VERBOSE_MSG(parent, "plan '%s' type '%s' uid [%i.%i]\n",
VERBOSE_MSG(parent, "plan '%s' type '%s' uid [%05u.%02u]\n",
name_str, type_str,
qry->request ? qry->request->uid : 0, qry->uid);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment