From 2e699d04ad816a401fb481a619e9a3b13dbb9a5e Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 21 Jan 2023 01:31:05 +0800 Subject: Parse CLI arguments with `https://github.com/skeeto/optparse` --- logging.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'logging.h') diff --git a/logging.h b/logging.h index 71e1407..a0f6f62 100644 --- a/logging.h +++ b/logging.h @@ -7,11 +7,18 @@ #include +#define die(args...) \ + do { \ + fprintf(stderr, args); \ + exit(1); \ + } while(0) + void *log_init(const char *filename); void log_free(void *logger); -void log_print(void *logger, const char *level, time_t ts, const char *filename, int lineno, const char *msg); +void log_print(void *logger, const char *level, time_t ts, const char *filename, + int lineno, const char *msg); #ifdef DEBUG #define log_debug(logger, msg) log_print((logger), "DEBUG", time(NULL), __FILE__, __LINE__, (msg)) -- cgit v1.2.3