diff options
| author | 2026-01-12 16:30:37 -0600 | |
|---|---|---|
| committer | 2026-01-12 16:30:37 -0600 | |
| commit | 2016dceaa9cfc65ee80ee7e433331390f4263744 (patch) | |
| tree | d0c97b2ab5fc1933298a050f167b6a68fff08c89 /lib/log.c | |
| parent | add support for verified files (diff) | |
download jobs
Diffstat (limited to 'lib/log.c')
| -rw-r--r-- | lib/log.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1,5 +1,6 @@ #include <string.h> #include <time.h> +#include <errno.h> #include "log.h" /* TODO: replace this with something thread-safe later. */ @@ -41,6 +42,7 @@ void vl_logv(unsigned level, const char *fmt, va_list args) char datebuf[MAX_LOGTIMELEN]; time_t now; struct tm now_tm; + int en = errno; if (log_level > level) return; if (level > LOG_ERROR) return; @@ -55,7 +57,9 @@ void vl_logv(unsigned level, const char *fmt, va_list args) strcpy(datebuf, "???"); } - fprintf(log_stream(level), "[%s] %s: %s\n", datebuf, log_names[level], buf); + fprintf(log_stream(level), "[%s] %5s: %s\n", datebuf, log_names[level], buf); + + errno = en; } void vl_log(unsigned level, const char *fmt, ...) |
