https://bugs.webkit.org/show_bug.cgi?id=76339
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Jan 2012 01:24:10 +0000 (01:24 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Jan 2012 01:24:10 +0000 (01:24 +0000)
Take a page from the Gtk and Qt ports and quiet these logs unless they
are explicitly enabled via environment variable.

Patch by Adam Treat <atreat@rim.com> on 2012-01-14
Reviewed by George Staikos.

* platform/blackberry/LoggingBlackBerry.cpp:
(WebCore::initializeLoggingChannelsIfNecessary):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105027 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/blackberry/LoggingBlackBerry.cpp

index 90e598b..b17e37a 100644 (file)
@@ -1,3 +1,15 @@
+2012-01-14  Adam Treat  <atreat@rim.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=76339
+
+        Take a page from the Gtk and Qt ports and quiet these logs unless they
+        are explicitly enabled via environment variable.
+
+        Reviewed by George Staikos.
+
+        * platform/blackberry/LoggingBlackBerry.cpp:
+        (WebCore::initializeLoggingChannelsIfNecessary):
+
 2011-11-09  Robert Hogan  <robert@webkit.org>
 
         CSS 2.1 failure: outline-color-applies-to* tests fail
index ea535f8..994d78e 100644 (file)
@@ -19,6 +19,8 @@
 #include "config.h"
 #include "Logging.h"
 
+#include <wtf/text/WTFString.h>
+
 namespace WebCore {
 
 static inline void initializeWithUserDefault(WTFLogChannel& channel, bool enabled)
@@ -36,30 +38,18 @@ void initializeLoggingChannelsIfNecessary()
         return;
     haveInitializedLoggingChannels = true;
 
-    initializeWithUserDefault(LogNotYetImplemented, true);
-    initializeWithUserDefault(LogFrames, true);
-    initializeWithUserDefault(LogLoading, true);
-    initializeWithUserDefault(LogPopupBlocking, true);
-    initializeWithUserDefault(LogEvents, true);
-    initializeWithUserDefault(LogEditing, true);
-    initializeWithUserDefault(LogLiveConnect, true);
-    initializeWithUserDefault(LogIconDatabase, false);
-    initializeWithUserDefault(LogSQLDatabase, false);
-    initializeWithUserDefault(LogSpellingAndGrammar, true);
-    initializeWithUserDefault(LogBackForward, true);
-    initializeWithUserDefault(LogHistory, true);
-    initializeWithUserDefault(LogPageCache, true);
-    initializeWithUserDefault(LogPlatformLeaks, true);
-    initializeWithUserDefault(LogNetwork, true);
-    initializeWithUserDefault(LogFTP, true);
-    initializeWithUserDefault(LogThreading, true);
-    initializeWithUserDefault(LogStorageAPI, true);
-    initializeWithUserDefault(LogMedia, true);
-    initializeWithUserDefault(LogPlugins, true);
-    initializeWithUserDefault(LogArchives, true);
-    initializeWithUserDefault(LogProgress, false);
-    initializeWithUserDefault(LogResourceLoading, false);
-    initializeWithUserDefault(LogFileAPI, true);
+    String logEnv = getenv("WEBKIT_DEBUG");
+    if (logEnv.isEmpty())
+        return;
+
+    Vector<String> logv;
+    logEnv.split(" ", logv);
+
+    Vector<String>::const_iterator it = logv.begin();
+    for (; it != logv.end(); ++it) {
+        if (WTFLogChannel* channel = getChannelFromName(*it))
+            channel->state = WTFLogChannelOn;
+    }
 }
 
 } // namespace WebCore