Changeset 41520 in webkit
- Timestamp:
- Mar 8, 2009 12:35:54 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r41517 r41520 1 2009-03-08 Gustavo Noronha Silva <gns@gnome.org> 2 3 Reviewed by Holger Freyther. 4 5 Implement proper logging for the GTK+ port, inspired by the one in 6 Qt. We use the WEBKIT_DEBUG environment variable which was already 7 being used to decide whether to setup a logger for soup or not. 8 9 * platform/gtk/LoggingGtk.cpp: 10 (WebCore::getChannelFromName): 11 (WebCore::InitializeLoggingChannelsIfNecessary): 12 * platform/network/soup/ResourceHandleSoup.cpp: 13 (WebCore::ensureSessionIsInitialized): 14 1 15 2009-03-07 Dan Bernstein <mitz@apple.com> 2 16 -
trunk/WebCore/platform/gtk/LoggingGtk.cpp
r29663 r41520 1 1 /* 2 2 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2009 Gustavo Noronha Silva <gns@gnome.org> 3 4 * 4 5 * This library is free software; you can redistribute it and/or … … 21 22 #include "Logging.h" 22 23 24 #include <glib.h> 25 #include <string.h> 26 23 27 namespace WebCore { 28 29 // Inspired by the code used by the Qt port 30 31 static WTFLogChannel* getChannelFromName(const char* channelName) 32 { 33 if (strlen(channelName) < 3) 34 return 0; 35 36 if (!g_ascii_strcasecmp(channelName, "BackForward")) 37 return &LogBackForward; 38 if (!g_ascii_strcasecmp(channelName, "Editing")) 39 return &LogEditing; 40 if (!g_ascii_strcasecmp(channelName, "Events")) 41 return &LogEvents; 42 if (!g_ascii_strcasecmp(channelName, "Frames")) 43 return &LogFrames; 44 if (!g_ascii_strcasecmp(channelName, "FTP")) 45 return &LogFTP; 46 if (!g_ascii_strcasecmp(channelName, "History")) 47 return &LogHistory; 48 if (!g_ascii_strcasecmp(channelName, "IconDatabase")) 49 return &LogIconDatabase; 50 if (!g_ascii_strcasecmp(channelName, "Loading")) 51 return &LogLoading; 52 if (!g_ascii_strcasecmp(channelName, "Media")) 53 return &LogMedia; 54 if (!g_ascii_strcasecmp(channelName, "Network")) 55 return &LogNetwork; 56 if (!g_ascii_strcasecmp(channelName, "NotYetImplemented")) 57 return &LogNotYetImplemented; 58 if (!g_ascii_strcasecmp(channelName, "PageCache")) 59 return &LogPageCache; 60 if (!g_ascii_strcasecmp(channelName, "PlatformLeaks")) 61 return &LogPlatformLeaks; 62 if (!g_ascii_strcasecmp(channelName, "Plugin")) 63 return &LogPlugin; 64 if (!g_ascii_strcasecmp(channelName, "PopupBlocking")) 65 return &LogPopupBlocking; 66 if (!g_ascii_strcasecmp(channelName, "SpellingAndGrammar")) 67 return &LogSpellingAndGrammar; 68 if (!g_ascii_strcasecmp(channelName, "SQLDatabase")) 69 return &LogSQLDatabase; 70 if (!g_ascii_strcasecmp(channelName, "StorageAPI")) 71 return &LogStorageAPI; 72 if (!g_ascii_strcasecmp(channelName, "TextConversion")) 73 return &LogTextConversion; 74 if (!g_ascii_strcasecmp(channelName, "Threading")) 75 return &LogThreading; 76 77 return 0; 78 } 24 79 25 80 void InitializeLoggingChannelsIfNecessary() 26 81 { 27 // FIXME: Add a way for the user to specify which 28 // logs he/she would like turned on. 82 static bool didInitializeLoggingChannels = false; 83 if (didInitializeLoggingChannels) 84 return; 85 86 didInitializeLoggingChannels = true; 87 88 char* logEnv = getenv("WEBKIT_DEBUG"); 89 if (!logEnv) 90 return; 91 92 // we set up the logs anyway because some of our logging, such as 93 // soup's is available in release builds 94 #if defined(NDEBUG) 95 g_warning("WEBKIT_DEBUG is not empty, but this is a release build. Notice that many log messages will only appear in a debug build."); 96 #endif 97 98 char** logv = g_strsplit(logEnv, " ", -1); 99 100 for (int i = 0; logv[i]; i++) { 101 WTFLogChannel* channel = getChannelFromName(logv[i]); 102 if (!channel) 103 continue; 104 channel->state = WTFLogChannelOn; 105 } 106 107 g_strfreev(logv); 108 109 // to disable logging notImplemented set the DISABLE_NI_WARNING 110 // environment variable to 1 29 111 LogNotYetImplemented.state = WTFLogChannelOn; 30 112 } -
trunk/WebCore/platform/network/soup/ResourceHandleSoup.cpp
r41483 r41520 34 34 #include "Frame.h" 35 35 #include "HTTPParsers.h" 36 #include "Logging.h" 36 37 #include "MIMETypeRegistry.h" 37 38 #include "NotImplemented.h" … … 402 403 setDefaultCookieJar(jar); 403 404 404 const char* webkitDebug = g_getenv("WEBKIT_DEBUG"); 405 if (!soup_session_get_feature(session, SOUP_TYPE_LOGGER) 406 && webkitDebug && !strcmp(webkitDebug, "network")) { 405 if (!soup_session_get_feature(session, SOUP_TYPE_LOGGER) && LogNetwork.state == WTFLogChannelOn) { 407 406 SoupLogger* logger = soup_logger_new(static_cast<SoupLoggerLogLevel>(SOUP_LOGGER_LOG_BODY), -1); 408 407 soup_logger_attach(logger, session);
Note: See TracChangeset
for help on using the changeset viewer.