diff options
author | Keuin <[email protected]> | 2021-12-30 12:20:42 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2021-12-30 12:20:42 +0800 |
commit | b3fd60e6407b3af029672218b0bff7bb30e7a9d9 (patch) | |
tree | 1536fec6761b9913a47117725fd5b4b5f70caa62 /logging.c | |
parent | 5651bc231389ebfa05e3750a431b33c28f4ed205 (diff) |
Add ping check (-p).
Support custom error handling command (-c).
Add runtime params validation for logging.
Diffstat (limited to 'logging.c')
-rw-r--r-- | logging.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -3,6 +3,7 @@ // #include "logging.h" +#include "validate.h" #include <stdio.h> @@ -17,6 +18,10 @@ void log_free(void *logger) { } void log_print(void *logger, const char *level, time_t ts, const char *filename, int lineno, const char *msg) { + NOTNULL(logger); + NOTNULL(level); + NOTNULL(filename); + NOTNULL(msg); char timestr[32]; strftime(timestr, 31, "%Y-%m-%d %H:%M:%S", localtime(&ts)); if (fprintf(logger, "[%s][%s][%s][%d] %s\n", timestr, level, filename, lineno, msg)) |