From c0e1c65491f9d6726b16f107c25f2e5787e7e2ec Mon Sep 17 00:00:00 2001 From: Wojciech Kosior Date: Thu, 7 May 2020 19:53:51 +0200 Subject: add mock of our logging facility --- src/0tDNS.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/0tDNS.c b/src/0tDNS.c index b4bbf42..fbd3a78 100644 --- a/src/0tDNS.c +++ b/src/0tDNS.c @@ -26,6 +26,11 @@ #include #include +#include "log.h" + +/* To specify when creating unbound context - has nothing to do with + * out logging facility + */ #define DEFAULT_DEBUGLEVEL 0 /* @@ -234,8 +239,13 @@ struct ztdns_instance *ztdns_create_instance(int argc, char **argv) struct ztdns_resolver *tmp; ztdns = malloc(sizeof(struct ztdns_instance)); - if (!ztdns) + if (!ztdns) { + /* This is an example of how rest of the code shold be + * written/rewritten to use our logging facility. + */ + ztdns_log(ERROR, "No memory, no fun :(\n"); return NULL; + } /* Create context for performing full resolution */ ztdns->ctx_full = -- cgit v1.2.3