 +  void PInternal(const char* aColor, const char* aFileName, const int aLineNum, Types&&...  aArgs)
 +  {
 +    printf_stderr("[%s] %s%s(%d) ", EZ_TAG, aColor, aFileName, aLineNum);
++#ifdef MOZ_XUL
++    ezPrint(mozilla::Forward<Types>(aArgs)...);
++#else
 +    ezPrint(std::forward<Types>(aArgs)...);
++#endif
 +  }
 +} //namespace
 +

+#define EZ_LIGHT_GRAY "\033[0;37m"
+#define EZ_WHITE "\033[1;37m"
+
+#include "nsLiteralString.h"
+#include "nsStringFwd.h"
+#include "nsString.h"


diff --git a/xpcom/glue/ezlogger.h b/xpcom/glue/ezlogger.h
new file mode 100644
index 0000000..8f62be9
--- /dev/null
+++ b/xpcom/glue/ezlogger.h
@@ -0,0 +1,236 @@
+#ifndef __EZLOGGER_H__
+#define __EZLOGGER_H__
+#include <stdio.h>
+#include <utility>
+#include <string>
+#include <stdint.h>
+#include <inttypes.h> // b2g has no <cinttypes>
+
+#ifndef MOZ_XUL // GECKO only
+#define printf_stderr printf
