[sgen] `mono_gc_printf` should not append newlines.
authorMark Probst <mark.probst@gmail.com>
Tue, 12 May 2015 21:15:25 +0000 (14:15 -0700)
committerMark Probst <mark.probst@gmail.com>
Tue, 12 May 2015 21:41:24 +0000 (14:41 -0700)
mono/sgen/sgen-gc.h
mono/utils/mono-logger-internal.h

index 35d4cfe1633be05d9a20a74ba21db75dbb824d99..4487420f1b99b3f3c507623ecae9bf99898a7d8c 100644 (file)
@@ -140,13 +140,13 @@ extern guint64 stat_objects_copied_major;
 
 #define SGEN_LOG(level, format, ...) do {      \
        if (G_UNLIKELY ((level) <= SGEN_MAX_DEBUG_LEVEL && (level) <= gc_debug_level)) {        \
-               mono_gc_printf (gc_debug_file, format, ##__VA_ARGS__);  \
+               mono_gc_printf (gc_debug_file, format "\n", ##__VA_ARGS__);     \
 } } while (0)
 
 #define SGEN_COND_LOG(level, cond, format, ...) do {   \
        if (G_UNLIKELY ((level) <= SGEN_MAX_DEBUG_LEVEL && (level) <= gc_debug_level)) {        \
                if (cond)       \
-                       mono_gc_printf (gc_debug_file, format, ##__VA_ARGS__);  \
+                       mono_gc_printf (gc_debug_file, format "\n", ##__VA_ARGS__);     \
 } } while (0)
 
 extern int gc_debug_level;
index 5d567ae5a7707e056d373fbc1cb27f5f7c4fa2c1..93fc010ac93bc2ef52f5ebaf1ce0420b12e12913 100644 (file)
@@ -93,7 +93,7 @@ mono_trace_message(MonoTraceMask mask, const char *format, ...)
 
 #if defined (PLATFORM_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
 
-#define mono_gc_printf(gc_log_file, format, ...) g_log ("mono-gc", G_LOG_LEVEL_MESSAGE, format "\n", ##__VA_ARGS__)
+#define mono_gc_printf(gc_log_file, format, ...) g_log ("mono-gc", G_LOG_LEVEL_MESSAGE, format, ##__VA_ARGS__)
 #define mono_runtime_printf(format, ...) g_log ("mono-rt", G_LOG_LEVEL_MESSAGE, format "\n", ##__VA_ARGS__)
 #define mono_runtime_printf_err(format, ...) g_log ("mono-rt", G_LOG_LEVEL_CRITICAL, format "\n", ##__VA_ARGS__)
 #define mono_runtime_stdout_fflush() do { } while (0)
@@ -101,7 +101,7 @@ mono_trace_message(MonoTraceMask mask, const char *format, ...)
 #else
 
 #define mono_gc_printf(gc_log_file, format, ...) do {  \
-       fprintf (gc_log_file, format "\n", ##__VA_ARGS__);      \
+       fprintf (gc_log_file, format, ##__VA_ARGS__);   \
        fflush (gc_log_file);   \
 } while (0)