diff options
author | Lukáš Ježek <lukas.jezek@nic.cz> | 2021-06-10 14:00:28 +0200 |
---|---|---|
committer | Tomas Krizek <tomas.krizek@nic.cz> | 2021-07-29 11:40:50 +0200 |
commit | 476a8000657edd691065699bca2083118b0e9600 (patch) | |
tree | 6d4e28256fb6ef95ddf8ee6510453ba4a3d254de /lib | |
parent | log: lua: add list_log_group (diff) | |
download | knot-resolver-476a8000657edd691065699bca2083118b0e9600.tar.xz knot-resolver-476a8000657edd691065699bca2083118b0e9600.zip |
log: remove NOVERBOSELOG option
Diffstat (limited to 'lib')
-rw-r--r-- | lib/layer.h | 26 | ||||
-rw-r--r-- | lib/layer/iterate.c | 6 | ||||
-rw-r--r-- | lib/resolve.c | 4 |
3 files changed, 15 insertions, 21 deletions
diff --git a/lib/layer.h b/lib/layer.h index 63812440..40e62c7d 100644 --- a/lib/layer.h +++ b/lib/layer.h @@ -8,21 +8,17 @@ #include "lib/defines.h" #include "lib/utils.h" -#ifdef NOVERBOSELOG - #define QRVERBOSE(query, cls, ...) -#else - /** Print a debug message related to resolution. - * \param _query associated kr_query, may be NULL - * \param _cls identifying string, typically of length exactly four (padded) - * \param ... printf-compatible list of parameters - */ - #define QRVERBOSE(_query, _cls, ...) do { \ - const struct kr_query *_qry = (_query); \ - if (VERBOSE_STATUS || kr_log_qtrace_enabled(_qry)) { \ - kr_log_q(_qry, (_cls), __VA_ARGS__); \ - } \ - } while (false) -#endif +/** Print a debug message related to resolution. + * \param _query associated kr_query, may be NULL + * \param _cls identifying string, typically of length exactly four (padded) + * \param ... printf-compatible list of parameters + */ +#define QRVERBOSE(_query, _cls, ...) do { \ + const struct kr_query *_qry = (_query); \ + if (VERBOSE_STATUS || kr_log_qtrace_enabled(_qry)) { \ + kr_log_q(_qry, (_cls), __VA_ARGS__); \ + } \ +} while (false) /** Layer processing states. Only one value at a time (but see TODO). * diff --git a/lib/layer/iterate.c b/lib/layer/iterate.c index efdcc73c..7be969b8 100644 --- a/lib/layer/iterate.c +++ b/lib/layer/iterate.c @@ -1064,9 +1064,9 @@ static int resolve(kr_layer_t *ctx, knot_pkt_t *pkt) * The most important part is to check for spoofing: is_paired_to_query() */ query->flags.PKT_IS_SANE = true; -#ifndef NOVERBOSELOG - const knot_lookup_t *rcode = knot_lookup_by_id(knot_rcode_names, knot_wire_get_rcode(pkt->wire)); -#endif + const knot_lookup_t *rcode = NULL; + if (KR_LOG_LEVEL_IS(LOG_DEBUG)) + rcode = knot_lookup_by_id(knot_rcode_names, knot_wire_get_rcode(pkt->wire)); // We can't return directly from the switch because we have to give feedback to server selection first int ret = 0; diff --git a/lib/resolve.c b/lib/resolve.c index d3fa992a..dfb6d6b6 100644 --- a/lib/resolve.c +++ b/lib/resolve.c @@ -1570,12 +1570,10 @@ int kr_resolve_finish(struct kr_request *request, int state) ITERATE_LAYERS(request, NULL, finish); -#ifndef NOVERBOSELOG struct kr_rplan *rplan = &request->rplan; struct kr_query *last = kr_rplan_last(rplan); VERBOSE_MSG(last, "finished in state: %d, queries: %zu, mempool: %zu B\n", - request->state, rplan->resolved.len, (size_t) mp_total_size(request->pool.ctx)); -#endif + request->state, rplan->resolved.len, (size_t) mp_total_size(request->pool.ctx)); /* Trace request finish */ if (request->trace_finish) { |