Bug 1159830 - Autophone - webappstartup should not use console.log to output WEBAPP STARTUP COMPLETE. r=snorp, r=froydnj

This commit is contained in:
Randall Barker 2015-05-29 09:58:04 -04:00
parent f7561e10df
commit a0e0215561
2 changed files with 16 additions and 2 deletions

View File

@ -909,3 +909,10 @@ pref("touchcaret.extendedvisibility", true);
// The TouchCaret and the SelectionCarets will indicate when the
// TextSelection actionbar is to be openned or closed.
pref("caret.manages-android-actionbar", true);
// Disable sending console to logcat on release builds.
#ifdef RELEASE_BUILD
pref("consoleservice.logcat", false);
#else
pref("consoleservice.logcat", true);
#endif

View File

@ -48,6 +48,10 @@ NS_IMPL_CI_INTERFACE_GETTER(nsConsoleService, nsIConsoleService)
static bool sLoggingEnabled = true;
static bool sLoggingBuffered = true;
#if defined(ANDROID)
static bool sLoggingLogcat = true;
#endif // defined(ANDROID)
nsConsoleService::nsConsoleService()
: mMessages(nullptr)
@ -86,6 +90,9 @@ public:
{
Preferences::AddBoolVarCache(&sLoggingEnabled, "consoleservice.enabled", true);
Preferences::AddBoolVarCache(&sLoggingBuffered, "consoleservice.buffered", true);
#if defined(ANDROID)
Preferences::AddBoolVarCache(&sLoggingLogcat, "consoleservice.logcat", true);
#endif // defined(ANDROID)
if (!sLoggingBuffered) {
mConsole->Reset();
}
@ -206,8 +213,8 @@ nsConsoleService::LogMessageWithMode(nsIConsoleMessage* aMessage,
{
MutexAutoLock lock(mLock);
#if defined(ANDROID) && !defined(RELEASE_BUILD)
if (aOutputMode == OutputToLog) {
#if defined(ANDROID)
if (sLoggingLogcat && aOutputMode == OutputToLog) {
nsCString msg;
aMessage->ToString(msg);