diff options
author | Keuin <[email protected]> | 2023-01-21 01:31:05 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2023-01-21 01:31:05 +0800 |
commit | 2e699d04ad816a401fb481a619e9a3b13dbb9a5e (patch) | |
tree | f6e52085e1765c38873f0ba7a6604d9f9fcf1c1b /logging.h | |
parent | a7e76224e0166692fe9527f7e539b6f8ea0728fd (diff) |
Parse CLI arguments with `https://github.com/skeeto/optparse`
Diffstat (limited to 'logging.h')
-rw-r--r-- | logging.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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)) |