diff options
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); } |