summaryrefslogtreecommitdiff
path: root/logging.c
diff options
context:
space:
mode:
authorKeuin <[email protected]>2021-12-30 12:20:42 +0800
committerKeuin <[email protected]>2021-12-30 12:20:42 +0800
commitb3fd60e6407b3af029672218b0bff7bb30e7a9d9 (patch)
tree1536fec6761b9913a47117725fd5b4b5f70caa62 /logging.c
parent5651bc231389ebfa05e3750a431b33c28f4ed205 (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.c5
1 files changed, 5 insertions, 0 deletions
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 <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))