diff options
author | onefang | 2021-08-25 19:30:46 +1000 |
---|---|---|
committer | onefang | 2021-08-25 19:30:46 +1000 |
commit | 9168e238f1e340a0ef9b370c19da7fa5f7c5c768 (patch) | |
tree | 99a5c302fd6429341ebe6694df4e47a9674b646b | |
parent | Log++ (diff) | |
download | opensim-SC-9168e238f1e340a0ef9b370c19da7fa5f7c5c768.zip opensim-SC-9168e238f1e340a0ef9b370c19da7fa5f7c5c768.tar.gz opensim-SC-9168e238f1e340a0ef9b370c19da7fa5f7c5c768.tar.bz2 opensim-SC-9168e238f1e340a0ef9b370c19da7fa5f7c5c768.tar.xz |
Tweak sledjchisl logging a bit.
-rw-r--r-- | src/sledjchisl/sledjchisl.c | 6 |
1 files 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, ...) | |||
573 | struct timeval tv; | 573 | struct timeval tv; |
574 | time_t curtime; | 574 | time_t curtime; |
575 | char date[DATE_TIME_LEN]; | 575 | char date[DATE_TIME_LEN]; |
576 | char *t; | ||
576 | 577 | ||
577 | if ((!VERBOSE) && (4 < v)) | 578 | if ((!VERBOSE) && (4 < v)) |
578 | return; | 579 | return; |
@@ -593,9 +594,10 @@ void logMe(int v, char *format, ...) | |||
593 | gettimeofday(&tv, NULL); | 594 | gettimeofday(&tv, NULL); |
594 | curtime = tv.tv_sec; | 595 | curtime = tv.tv_sec; |
595 | strftime(date, DATE_TIME_LEN, "(%Z %z) %F %T", localtime(&curtime)); | 596 | strftime(date, DATE_TIME_LEN, "(%Z %z) %F %T", localtime(&curtime)); |
596 | 597 | t = xmprintf("%.6d", (int) tv.tv_usec); | |
597 | v *= 2; | 598 | v *= 2; |
598 | fprintf(stderr, "%s.%.6ld \e[%sm%-8s sledjchisl: %s\e[0m\n", date, tv.tv_usec, logTypes[v], logTypes[v + 1], ret); | 599 | fprintf(stderr, "%s.%.2s \e[%sm%-8s %s\e[0m\n", date, t, logTypes[v], logTypes[v + 1], ret); |
600 | free(t); | ||
599 | free(ret); | 601 | free(ret); |
600 | } | 602 | } |
601 | #define C(...) logMe(0, __VA_ARGS__) | 603 | #define C(...) logMe(0, __VA_ARGS__) |