Bug 958596 - Add support for gfx logging on android and b2g. r=Bas
☠☠ backed out by a442f3946ac3 ☠ ☠
authorBotond Ballo <botond@mozilla.com>
Tue, 21 Jan 2014 20:11:52 -0500
changeset 170754 dfadc8e2c38e88bcc0abedf7ed085d78c37472f8
parent 170753 07f3cfaa79004858f4466a71b0b83f2ed035e472
child 170755 b190a7268dd4bc844f7565d88f62154e7ae06773
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersBas
bugs958596
milestone30.0a1
Bug 958596 - Add support for gfx logging on android and b2g. r=Bas
gfx/2d/Logging.h
--- a/gfx/2d/Logging.h
+++ b/gfx/2d/Logging.h
@@ -5,16 +5,17 @@
 
 #ifndef MOZILLA_GFX_LOGGING_H_
 #define MOZILLA_GFX_LOGGING_H_
 
 #include <string>
 #include <sstream>
 #include <stdio.h>
 
+#include "nsDebug.h"
 #include "Point.h"
 #include "Matrix.h"
 
 #ifdef WIN32
 // This file gets included from nsGlobalWindow.cpp, which doesn't like
 // having windows.h included in it. Since OutputDebugStringA is the only
 // thing we need from windows.h, we just declare it here directly.
 // Note: the function's documented signature is
@@ -52,23 +53,23 @@ inline PRLogModuleLevel PRLogLevelForLev
 
 extern GFX2D_API int sGfxLogLevel;
 
 static inline void OutputMessage(const std::string &aString, int aLevel) {
 #if defined(WIN32) && !defined(PR_LOGGING)
   if (aLevel >= sGfxLogLevel) {
     ::OutputDebugStringA(aString.c_str());
   }
-#elif defined(PR_LOGGING)
+#elif defined(PR_LOGGING) && !(defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID))
   if (PR_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) {
     PR_LogPrint(aString.c_str());
   }
 #else
   if (aLevel >= sGfxLogLevel) {
-    printf("%s", aString.c_str());
+    printf_stderr("%s", aString.c_str());
   }
 #endif
 }
 
 class NoLog
 {
 public:
   NoLog() {}