Procházet zdrojové kódy

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 před 2 roky
rodič
revize
b5022015fc
1 změnil soubory, kde provedl 2 přidání a 0 odebrání
  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,
              "%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 ":%03" PRIu32, h, m, s,
              mills);
              mills);
 
 
+#ifndef BH_VPRINTF
     os_printf("[%s - %" PRIXPTR "]: ", buf, (uintptr_t)self);
     os_printf("[%s - %" PRIXPTR "]: ", buf, (uintptr_t)self);
+#endif
 
 
     if (file)
     if (file)
         os_printf("%s, line %d, ", file, line);
         os_printf("%s, line %d, ", file, line);