From 9168e238f1e340a0ef9b370c19da7fa5f7c5c768 Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 25 Aug 2021 19:30:46 +1000 Subject: Tweak sledjchisl logging a bit. --- src/sledjchisl/sledjchisl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index acf229a..501c7d1 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -573,6 +573,7 @@ void logMe(int v, char *format, ...) struct timeval tv; time_t curtime; char date[DATE_TIME_LEN]; + char *t; if ((!VERBOSE) && (4 < v)) return; @@ -593,9 +594,10 @@ void logMe(int v, char *format, ...) gettimeofday(&tv, NULL); curtime = tv.tv_sec; strftime(date, DATE_TIME_LEN, "(%Z %z) %F %T", localtime(&curtime)); - + t = xmprintf("%.6d", (int) tv.tv_usec); v *= 2; - fprintf(stderr, "%s.%.6ld \e[%sm%-8s sledjchisl: %s\e[0m\n", date, tv.tv_usec, logTypes[v], logTypes[v + 1], ret); + fprintf(stderr, "%s.%.2s \e[%sm%-8s %s\e[0m\n", date, t, logTypes[v], logTypes[v + 1], ret); + free(t); free(ret); } #define C(...) logMe(0, __VA_ARGS__) -- cgit v1.1