diff --git a/mozglue/baseprofiler/core/platform.h b/mozglue/baseprofiler/core/platform.h index 133a30162932..5915eaf9d2fb 100644 --- a/mozglue/baseprofiler/core/platform.h +++ b/mozglue/baseprofiler/core/platform.h @@ -46,34 +46,34 @@ bool BaseProfilerLogTest(int aLevelToTest); // These are for MOZ_BASE_PROFILER_LOGGING and above. It's the default logging // level for the profiler, and should be used sparingly. #define LOG_TEST BaseProfilerLogTest(3) -#define LOG(arg, ...) \ - do { \ - if (LOG_TEST) { \ - printf("[I %d/%d] " arg "\n", profiler_current_process_id(), \ - profiler_current_thread_id(), ##__VA_ARGS__); \ - } \ +#define LOG(arg, ...) \ + do { \ + if (LOG_TEST) { \ + fprintf(stderr, "[I %d/%d] " arg "\n", profiler_current_process_id(), \ + profiler_current_thread_id(), ##__VA_ARGS__); \ + } \ } while (0) // These are for MOZ_BASE_PROFILER_DEBUG_LOGGING. It should be used for logging // that is somewhat more verbose than LOG. #define DEBUG_LOG_TEST BaseProfilerLogTest(4) -#define DEBUG_LOG(arg, ...) \ - do { \ - if (DEBUG_LOG_TEST) { \ - printf("[D %d/%d] " arg "\n", profiler_current_process_id(), \ - profiler_current_thread_id(), ##__VA_ARGS__); \ - } \ +#define DEBUG_LOG(arg, ...) \ + do { \ + if (DEBUG_LOG_TEST) { \ + fprintf(stderr, "[D %d/%d] " arg "\n", profiler_current_process_id(), \ + profiler_current_thread_id(), ##__VA_ARGS__); \ + } \ } while (0) // These are for MOZ_BASE_PROFILER_VERBOSE_LOGGING. It should be used for // logging that is somewhat more verbose than DEBUG_LOG. #define VERBOSE_LOG_TEST BaseProfilerLogTest(5) -#define VERBOSE_LOG(arg, ...) \ - do { \ - if (VERBOSE_LOG_TEST) { \ - printf("[V %d/%d] " arg "\n", profiler_current_process_id(), \ - profiler_current_thread_id(), ##__VA_ARGS__); \ - } \ +#define VERBOSE_LOG(arg, ...) \ + do { \ + if (VERBOSE_LOG_TEST) { \ + fprintf(stderr, "[V %d/%d] " arg "\n", profiler_current_process_id(), \ + profiler_current_thread_id(), ##__VA_ARGS__); \ + } \ } while (0) namespace mozilla {