Changeset 220947 in webkit


Ignore:
Timestamp:
Aug 18, 2017 5:30:59 PM (7 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r220938.

The API tests added with this change are failing.

Reverted changeset:

"Add WTFLogChannel level to allow runtime log filtering"
https://bugs.webkit.org/show_bug.cgi?id=175731
http://trac.webkit.org/changeset/220938

Location:
trunk
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r220938 r220947  
     12017-08-18  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r220938.
     4
     5        The API tests added with this change are failing.
     6
     7        Reverted changeset:
     8
     9        "Add WTFLogChannel level to allow runtime log filtering"
     10        https://bugs.webkit.org/show_bug.cgi?id=175731
     11        http://trac.webkit.org/changeset/220938
     12
    1132017-08-18  Eric Carlson  <eric.carlson@apple.com>
    214
  • trunk/Source/WTF/wtf/Assertions.cpp

    r220938 r220947  
    411411}
    412412
    413 void WTFSetLogChannelLevel(WTFLogChannel* channel, WTFLogLevel level)
    414 {
    415     channel->level = level;
    416     WTFLog(channel, "Channel \"%s\" level set to %i", channel->name, level);
    417 }
    418 
    419 bool WTFWillLogWithLevel(WTFLogChannel* channel, WTFLogLevel level)
    420 {
    421     return channel->level >= level && channel->state != WTFLogChannelOff;
    422 }
    423 
    424 void WTFLogWithLevel(WTFLogChannel* channel, WTFLogLevel level, const char* format, ...)
    425 {
    426     if (channel->level < level)
    427         return;
    428 
    429     if (channel->state == WTFLogChannelOff)
    430         return;
    431 
    432     va_list args;
    433     va_start(args, format);
    434 
    435 #if COMPILER(CLANG)
    436 #pragma clang diagnostic push
    437 #pragma clang diagnostic ignored "-Wformat-nonliteral"
    438 #endif
    439     WTFLog(channel, format, args);
    440 #if COMPILER(CLANG)
    441 #pragma clang diagnostic pop
    442 #endif
    443 
    444     va_end(args);
    445 }
    446 
    447413void WTFLog(WTFLogChannel* channel, const char* format, ...)
    448414{
     
    557523
    558524    for (size_t i = 0; i < components.size(); ++i) {
    559         Vector<String> componentInfo;
    560         components[i].split('=', componentInfo);
    561         String component = componentInfo[0].stripWhiteSpace();
     525        String component = components[i];
    562526
    563527        WTFLogChannelState logChannelState = WTFLogChannelOn;
     
    572536        }
    573537
    574         WTFLogLevel logChannelLevel = WTFLogLevelError;
    575         if (componentInfo.size() > 1) {
    576             String level = componentInfo[1].stripWhiteSpace();
    577             if (equalLettersIgnoringASCIICase(level, "error"))
    578                 logChannelLevel = WTFLogLevelError;
    579             else if (equalLettersIgnoringASCIICase(level, "warning"))
    580                 logChannelLevel = WTFLogLevelWarning;
    581             else if (equalLettersIgnoringASCIICase(level, "info"))
    582                 logChannelLevel = WTFLogLevelInfo;
    583             else if (equalLettersIgnoringASCIICase(level, "debug"))
    584                 logChannelLevel = WTFLogLevelDebug;
    585             else
    586                 WTFLogAlways("Unknown logging level: %s", level.utf8().data());
    587         }
    588 
    589         if (WTFLogChannel* channel = WTFLogChannelByName(channels, count, component.utf8().data())) {
     538        if (WTFLogChannel* channel = WTFLogChannelByName(channels, count, component.utf8().data()))
    590539            channel->state = logChannelState;
    591             channel->level = logChannelLevel;
    592         } else
     540        else
    593541            WTFLogAlways("Unknown logging channel: %s", component.utf8().data());
    594542    }
  • trunk/Source/WTF/wtf/Assertions.h

    r220938 r220947  
    149149
    150150typedef enum { WTFLogChannelOff, WTFLogChannelOn, WTFLogChannelOnWithAccumulation } WTFLogChannelState;
    151 typedef enum { WTFLogLevelError, WTFLogLevelWarning, WTFLogLevelInfo, WTFLogLevelDebug } WTFLogLevel;
    152151
    153152typedef struct {
    154153    WTFLogChannelState state;
    155154    const char* name;
    156     WTFLogLevel level;
    157155#if !RELEASE_LOG_DISABLED
    158156    const char* subsystem;
     
    174172#if RELEASE_LOG_DISABLED
    175173#define DEFINE_LOG_CHANNEL(name, subsystem) \
    176     WTFLogChannel LOG_CHANNEL(name) = { WTFLogChannelOff, #name, WTFLogLevelError };
     174    WTFLogChannel LOG_CHANNEL(name) = { WTFLogChannelOff, #name };
    177175#else
    178176#define DEFINE_LOG_CHANNEL(name, subsystem) \
    179     WTFLogChannel LOG_CHANNEL(name) = { WTFLogChannelOff, #name, WTFLogLevelError, subsystem, OS_LOG_DEFAULT };
     177    WTFLogChannel LOG_CHANNEL(name) = { WTFLogChannelOff, #name, subsystem, OS_LOG_DEFAULT };
    180178#endif
    181179#endif
     
    193191WTF_EXPORT_PRIVATE WTFLogChannel* WTFLogChannelByName(WTFLogChannel*[], size_t count, const char*);
    194192WTF_EXPORT_PRIVATE void WTFInitializeLogChannelStatesFromString(WTFLogChannel*[], size_t count, const char*);
    195 WTF_EXPORT_PRIVATE void WTFLogWithLevel(WTFLogChannel*, WTFLogLevel, const char* format, ...) WTF_ATTRIBUTE_PRINTF(3, 4);
    196 WTF_EXPORT_PRIVATE void WTFSetLogChannelLevel(WTFLogChannel*, WTFLogLevel);
    197 WTF_EXPORT_PRIVATE bool WTFWillLogWithLevel(WTFLogChannel*, WTFLogLevel);
    198193
    199194WTF_EXPORT_PRIVATE void WTFGetBacktrace(void** stack, int* size);
     
    433428#endif
    434429
    435 /* LOG_WITH_LEVEL */
    436 
    437 #if LOG_DISABLED
    438 #define LOG_WITH_LEVEL(channel, level, ...) ((void)0)
    439 #else
    440 #define LOG_WITH_LEVEL(channel, level, ...) WTFLogWithLevel(&LOG_CHANNEL(channel), level, __VA_ARGS__)
    441 #endif
    442 
    443430/* RELEASE_LOG */
    444431
     
    449436#define RELEASE_LOG_IF(      isAllowed, channel, format, ...) ((void)0)
    450437#define RELEASE_LOG_ERROR_IF(isAllowed, channel, format, ...) do { if (isAllowed) RELEASE_LOG_ERROR(channel, format, ##__VA_ARGS__); } while (0)
    451 
    452 #define RELEASE_LOG_WITH_LEVEL(              channel, level, format, ...) ((void)0)
    453 #define RELEASE_LOG_WITH_LEVEL_IF(isAllowed, channel, level, format, ...) do { if (isAllowed) RELEASE_LOG_WITH_LEVEL(channel, level, format, ##__VA_ARGS__); } while (0)
    454438#else
    455439#define RELEASE_LOG(      channel, format, ...) os_log(      LOG_CHANNEL(channel).osLogChannel, format, ##__VA_ARGS__)
     
    458442#define RELEASE_LOG_IF(      isAllowed, channel, format, ...) do { if (isAllowed) RELEASE_LOG(      channel, format, ##__VA_ARGS__); } while (0)
    459443#define RELEASE_LOG_ERROR_IF(isAllowed, channel, format, ...) do { if (isAllowed) RELEASE_LOG_ERROR(channel, format, ##__VA_ARGS__); } while (0)
    460 
    461 #define RELEASE_LOG_WITH_LEVEL(channel, logLevel, format, ...) do { \
    462     if (LOG_CHANNEL(channel).level >= (logLevel)) \
    463         os_log(LOG_CHANNEL(channel).osLogChannel, format, ##__VA_ARGS__); \
    464 } while (0)
    465 
    466 #define RELEASE_LOG_WITH_LEVEL_IF(isAllowed, channel, logLevel, format, ...) do { \
    467     if ((isAllowed) && LOG_CHANNEL(channel).level >= (logLevel)) \
    468         os_log(LOG_CHANNEL(channel).osLogChannel, format, ##__VA_ARGS__); \
    469 } while (0)
    470444#endif
    471445
  • trunk/Source/WTF/wtf/MemoryPressureHandler.cpp

    r220938 r220947  
    3535
    3636#if RELEASE_LOG_DISABLED
    37 WTFLogChannel LogMemoryPressure = { WTFLogChannelOn, "MemoryPressure", WTFLogLevelError };
     37WTFLogChannel LogMemoryPressure = { WTFLogChannelOn, "MemoryPressure" };
    3838#else
    39 WTFLogChannel LogMemoryPressure = { WTFLogChannelOn, "MemoryPressure", WTFLogLevelError, LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
     39WTFLogChannel LogMemoryPressure = { WTFLogChannelOn, "MemoryPressure", LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
    4040#endif
    4141
  • trunk/Source/WTF/wtf/RefCountedLeakCounter.cpp

    r220938 r220947  
    4141#define LOG_CHANNEL_PREFIX Log
    4242#if RELEASE_LOG_DISABLED
    43 static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn, "RefCountedLeaks", WTFLogLevelError };
     43static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn, "RefCountedLeaks" };
    4444#else
    45 static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn, "RefCountedLeaks", WTFLogLevelError, LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
     45static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn, "RefCountedLeaks", LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
    4646#endif
    4747
  • trunk/Tools/ChangeLog

    r220945 r220947  
     12017-08-18  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r220938.
     4
     5        The API tests added with this change are failing.
     6
     7        Reverted changeset:
     8
     9        "Add WTFLogChannel level to allow runtime log filtering"
     10        https://bugs.webkit.org/show_bug.cgi?id=175731
     11        http://trac.webkit.org/changeset/220938
     12
    1132017-08-18  Devin Rousso  <webkit@devinrousso.com>
    214
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r220938 r220947  
    2626                07492B3C1DF8B86600633DE1 /* enumerateMediaDevices.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 07492B391DF8ADA400633DE1 /* enumerateMediaDevices.html */; };
    2727                074994421EA5034B000DA44E /* getUserMedia.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 4A410F4D19AF7BEF002EBAB5 /* getUserMedia.html */; };
    28                 076E507F1F4513D6006E9F5A /* Logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 076E507E1F45031E006E9F5A /* Logging.cpp */; };
    2928                0799C3491EBA2D7B003B7532 /* UserMediaDisabled.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07EDEFAC1EB9400C00D43292 /* UserMediaDisabled.mm */; };
    3029                0799C34B1EBA3301003B7532 /* disableGetUserMedia.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 0799C34A1EBA32F4003B7532 /* disableGetUserMedia.html */; };
     
    992991                07492B3A1DF8AE2D00633DE1 /* EnumerateMediaDevices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EnumerateMediaDevices.cpp; sourceTree = "<group>"; };
    993992                0766DD1F1A5AD5200023E3BB /* PendingAPIRequestURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PendingAPIRequestURL.cpp; sourceTree = "<group>"; };
    994                 076E507E1F45031E006E9F5A /* Logging.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Logging.cpp; sourceTree = "<group>"; };
    995993                0799C34A1EBA32F4003B7532 /* disableGetUserMedia.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = disableGetUserMedia.html; sourceTree = "<group>"; };
    996994                07C046C91E42573E007201E7 /* CARingBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CARingBuffer.cpp; sourceTree = "<group>"; };
     
    20332031                                7A909A751D877475007E10F8 /* IntSize.cpp */,
    20342032                                14464012167A8305000BD218 /* LayoutUnit.cpp */,
    2035                                 076E507E1F45031E006E9F5A /* Logging.cpp */,
    20362033                                CD225C071C45A69200140761 /* ParsedContentRange.cpp */,
    20372034                                CDCFA7A91E45122F00C2433D /* SampleMap.cpp */,
     
    32583255                                7CCE7F0C1A411AE600447C4C /* PrivateBrowsingPushStateNoHistoryCallback.cpp in Sources */,
    32593256                                4647B1261EBA3B850041D7EF /* ProcessDidTerminate.cpp in Sources */,
    3260                                 076E507F1F4513D6006E9F5A /* Logging.cpp in Sources */,
    32613257                                7C83E0C11D0A652F00FEBCF3 /* ProvisionalURLNotChange.mm in Sources */,
    32623258                                7CCE7EC81A411A7E00447C4C /* PublicSuffix.mm in Sources */,
Note: See TracChangeset for help on using the changeset viewer.