diff options
author | Wojciech Kosior <kwojtus@protonmail.com> | 2020-05-07 20:14:12 +0200 |
---|---|---|
committer | Wojciech Kosior <kwojtus@protonmail.com> | 2020-05-07 20:14:12 +0200 |
commit | a3925cfc4a332acf6d62da162a407673a78c028e (patch) | |
tree | 790eedda6c5fa6d3390ed87026bc48fc3ba1692e | |
parent | c0e1c65491f9d6726b16f107c25f2e5787e7e2ec (diff) | |
download | 0tdns-a3925cfc4a332acf6d62da162a407673a78c028e.tar.gz 0tdns-a3925cfc4a332acf6d62da162a407673a78c028e.zip |
change logging approach
-rw-r--r-- | include/log.h | 16 | ||||
-rw-r--r-- | src/0tDNS.c | 2 |
2 files changed, 8 insertions, 10 deletions
diff --git a/include/log.h b/include/log.h index 91d968f..154e6ec 100644 --- a/include/log.h +++ b/include/log.h @@ -3,15 +3,13 @@ #include <stdio.h> -#define ERROR 1 -#define WARN 2 -#define INFO 3 -#define DEBUG 4 - -/* This function will change later - it's just a "mock", so that every1 can - * already write code with ztdns_log() :) - * Use like ztdns_log(DEBUG, "something wrong happened! %s", errorstring); +/* These functions will change later - it's just a "mock", so that every1 can + * already write code with ztdns_info() :) + * Use like ztdns_info("something wrong happened! %s", errorstring); */ -#define ztdns_log(level, printfargs...) printf(printfargs) +#define ztdns_debug(printfargs...) printf(printfargs) +#define ztdns_info(printfargs...) printf(printfargs) +#define ztdns_warn(printfargs...) printf(printfargs) +#define ztdns_error(printfargs...) printf(printfargs) #endif /* ZTDNS_LOG_H */ diff --git a/src/0tDNS.c b/src/0tDNS.c index fbd3a78..0170dd6 100644 --- a/src/0tDNS.c +++ b/src/0tDNS.c @@ -243,7 +243,7 @@ struct ztdns_instance *ztdns_create_instance(int argc, char **argv) /* 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"); + ztdns_error("No memory, no fun :(\n"); return NULL; } |