Merge pull request #496 from nicolas-raoul/unit-test-for-issue2907
[mono.git] / mono / utils / mono-logger-internal.h
index 10bcf17533b1276ede2233e440fdeb28352d08a3..1b50682e43b64dcd620bedcda6f310b981f7643a 100644 (file)
@@ -91,6 +91,27 @@ mono_trace_message(MonoTraceMask mask, const char *format, ...)
 
 #endif /* !__GNUC__ */
 
+#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_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_ERROR, format "\n", ##__VA_ARGS__)
+#define mono_runtime_stdout_fflush() do { } while (0)
+
+#else
+
+#define mono_gc_printf(gc_log_file, format, ...) do {  \
+       fprintf (gc_log_file, format "\n", ##__VA_ARGS__);      \
+       fflush (gc_log_file);   \
+} while (0)
+
+#define mono_runtime_printf(format, ...) fprintf (stdout, format "\n", ##__VA_ARGS__)
+#define mono_runtime_printf_err(format, ...) fprintf (stderr, format "\n", ##__VA_ARGS__)
+#define mono_runtime_stdout_fflush() do { fflush (stdout); } while (0)
+
+#endif
+
+
 G_END_DECLS
 
 #endif /* __MONO_LOGGER_INTERNAL_H__ */