summaryrefslogtreecommitdiff
path: root/logging.h
diff options
context:
space:
mode:
authorKeuin <[email protected]>2023-01-21 01:31:05 +0800
committerKeuin <[email protected]>2023-01-21 01:31:05 +0800
commit2e699d04ad816a401fb481a619e9a3b13dbb9a5e (patch)
treef6e52085e1765c38873f0ba7a6604d9f9fcf1c1b /logging.h
parenta7e76224e0166692fe9527f7e539b6f8ea0728fd (diff)
Parse CLI arguments with `https://github.com/skeeto/optparse`
Diffstat (limited to 'logging.h')
-rw-r--r--logging.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/logging.h b/logging.h
index 71e1407..a0f6f62 100644
--- a/logging.h
+++ b/logging.h
@@ -7,11 +7,18 @@
#include <time.h>
+#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))