From b5022015fce7dcc97f4ad00997b09448769a7f89 Mon Sep 17 00:00:00 2001 From: Enrico Loparco Date: Thu, 14 Dec 2023 07:55:17 +0100 Subject: [PATCH] Avoid reporting timestamp if custom logger is used (#2905) Loggers (e.g. glog) usually come with instrumentation to add timestamp and other information when reporting. That results in the timestamp being reported twice, making the output confusing. --- core/shared/utils/bh_log.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/shared/utils/bh_log.c b/core/shared/utils/bh_log.c index 78c058065..7bb3d3363 100644 --- a/core/shared/utils/bh_log.c +++ b/core/shared/utils/bh_log.c @@ -43,7 +43,9 @@ bh_log(LogLevel log_level, const char *file, int line, const char *fmt, ...) "%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 ":%03" PRIu32, h, m, s, mills); +#ifndef BH_VPRINTF os_printf("[%s - %" PRIXPTR "]: ", buf, (uintptr_t)self); +#endif if (file) os_printf("%s, line %d, ", file, line);