diff options
author | Keuin <[email protected]> | 2023-01-21 01:34:58 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2023-01-21 01:40:19 +0800 |
commit | c3122720152bb00e7c0e0fb86fd2d94a23c4abf9 (patch) | |
tree | 0b5f73c4622e482dab7206dc8b31bf0ccc4bddd6 /logging.c | |
parent | 2e699d04ad816a401fb481a619e9a3b13dbb9a5e (diff) |
Diffstat (limited to 'logging.c')
-rw-r--r-- | logging.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -17,15 +17,18 @@ void log_free(void *logger) { fclose(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) { 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)) + if (fprintf(logger, "[%s][%s][%s][%d] %s\n", timestr, level, filename, + lineno, msg)) fflush(logger); - if (fprintf(stderr, "[%s][%s][%s][%d] %s\n", timestr, level, filename, lineno, msg)) + if (fprintf(stderr, "[%s][%s][%s][%d] %s\n", timestr, level, filename, + lineno, msg)) fflush(stderr); } |