Skip to content
Snippets Groups Projects
Commit 07ef0d92 authored by Ondřej Surý's avatar Ondřej Surý
Browse files

Rename NDEBUG to NLOGDEBUG to allow disabling assert()s while keeping logging enabled

parent ea61de27
2 merge requests!92Change NDEBUG to verbose logging,!90Rename NDEBUG to NLOGDEBUG to allow disabling assert()s while keeping logging enabled
......@@ -100,7 +100,7 @@ When you have all the dependencies ready, you can build and install.
$ make PREFIX="/usr/local"
$ make install PREFIX="/usr/local"
.. note:: Always build with ``PREFIX`` if you want to install, as it is hardcoded in the executable for module search path. If you build the binary with ``-DNDEBUG``, verbose logging will be disabled as well.
.. note:: Always build with ``PREFIX`` if you want to install, as it is hardcoded in the executable for module search path. If you build the binary with ``-DNLOGDEBUG``, verbose logging will be disabled as well.
Alternatively you can build only specific parts of the project, i.e. ``library``.
......
......@@ -19,7 +19,7 @@
#include "lib/defines.h"
#include "lib/utils.h"
#ifndef NDEBUG
#ifndef NLOGDEBUG
/** @internal Print a debug message related to resolution. */
#define QRDEBUG(query, cls, fmt, ...) do { \
unsigned _ind = 0; \
......
......@@ -616,7 +616,7 @@ static int resolve(kr_layer_t *ctx, knot_pkt_t *pkt)
return KR_STATE_CONSUME;
}
#ifndef NDEBUG
#ifndef NLOGDEBUG
const knot_lookup_t *rcode = knot_lookup_by_id(knot_rcode_names, knot_wire_get_rcode(pkt->wire));
#endif
......
......@@ -1032,7 +1032,7 @@ int kr_resolve_checkout(struct kr_request *request, struct sockaddr *src,
int kr_resolve_finish(struct kr_request *request, int state)
{
#ifndef NDEBUG
#ifndef NLOGDEBUG
struct kr_rplan *rplan = &request->rplan;
#endif
/* Finalize answer */
......
......@@ -31,7 +31,7 @@
*/
#define kr_log_info(fmt, ...) do { printf((fmt), ## __VA_ARGS__); fflush(stdout); } while(0)
#define kr_log_error(fmt, ...) fprintf(stderr, (fmt), ## __VA_ARGS__)
#ifndef NDEBUG
#ifndef NLOGDEBUG
/* Toggle debug messages */
KR_EXPORT bool kr_debug_set(bool status);
KR_EXPORT KR_PURE bool kr_debug_status(void);
......
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