Bug 702029 - Push all console logging to androids adb logcat. r=blassey

This commit is contained in:
Doug Turner 2011-11-14 19:12:20 -08:00
parent a94842c06f
commit daffb2c587

View File

@ -53,6 +53,10 @@
#include "nsConsoleMessage.h"
#include "nsIClassInfoImpl.h"
#if defined(ANDROID)
#include <android/log.h>
#endif
using namespace mozilla;
NS_IMPL_THREADSAFE_ADDREF(nsConsoleService)
@ -135,6 +139,16 @@ nsConsoleService::LogMessage(nsIConsoleMessage *message)
{
MutexAutoLock lock(mLock);
#if defined(ANDROID)
{
nsXPIDLString msg;
message->GetMessageMoz(getter_Copies(msg));
__android_log_print(ANDROID_LOG_ERROR, "Gecko *** Console Service *** ",
"%s",
NS_LossyConvertUTF16toASCII(msg).get());
}
#endif
/*
* If there's already a message in the slot we're about to replace,
* we've wrapped around, and we need to release the old message. We