Просмотр исходного кода

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.
Enrico Loparco 2 лет назад
Родитель
Сommit
b5022015fc
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      core/shared/utils/bh_log.c

+ 2 - 0
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);