From b3fd60e6407b3af029672218b0bff7bb30e7a9d9 Mon Sep 17 00:00:00 2001 From: Keuin Date: Thu, 30 Dec 2021 12:20:42 +0800 Subject: Add ping check (-p). Support custom error handling command (-c). Add runtime params validation for logging. --- logging.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'logging.c') diff --git a/logging.c b/logging.c index 2ad1704..90ccf23 100644 --- a/logging.c +++ b/logging.c @@ -3,6 +3,7 @@ // #include "logging.h" +#include "validate.h" #include @@ -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)) -- cgit v1.2.3