Changeset 220947 in webkit
- Timestamp:
- Aug 18, 2017 5:30:59 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r220938 r220947 1 2017-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 1 13 2017-08-18 Eric Carlson <eric.carlson@apple.com> 2 14 -
trunk/Source/WTF/wtf/Assertions.cpp
r220938 r220947 411 411 } 412 412 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 push437 #pragma clang diagnostic ignored "-Wformat-nonliteral"438 #endif439 WTFLog(channel, format, args);440 #if COMPILER(CLANG)441 #pragma clang diagnostic pop442 #endif443 444 va_end(args);445 }446 447 413 void WTFLog(WTFLogChannel* channel, const char* format, ...) 448 414 { … … 557 523 558 524 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]; 562 526 563 527 WTFLogChannelState logChannelState = WTFLogChannelOn; … … 572 536 } 573 537 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())) 590 539 channel->state = logChannelState; 591 channel->level = logChannelLevel; 592 } else 540 else 593 541 WTFLogAlways("Unknown logging channel: %s", component.utf8().data()); 594 542 } -
trunk/Source/WTF/wtf/Assertions.h
r220938 r220947 149 149 150 150 typedef enum { WTFLogChannelOff, WTFLogChannelOn, WTFLogChannelOnWithAccumulation } WTFLogChannelState; 151 typedef enum { WTFLogLevelError, WTFLogLevelWarning, WTFLogLevelInfo, WTFLogLevelDebug } WTFLogLevel;152 151 153 152 typedef struct { 154 153 WTFLogChannelState state; 155 154 const char* name; 156 WTFLogLevel level;157 155 #if !RELEASE_LOG_DISABLED 158 156 const char* subsystem; … … 174 172 #if RELEASE_LOG_DISABLED 175 173 #define DEFINE_LOG_CHANNEL(name, subsystem) \ 176 WTFLogChannel LOG_CHANNEL(name) = { WTFLogChannelOff, #name , WTFLogLevelError};174 WTFLogChannel LOG_CHANNEL(name) = { WTFLogChannelOff, #name }; 177 175 #else 178 176 #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 }; 180 178 #endif 181 179 #endif … … 193 191 WTF_EXPORT_PRIVATE WTFLogChannel* WTFLogChannelByName(WTFLogChannel*[], size_t count, const char*); 194 192 WTF_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);198 193 199 194 WTF_EXPORT_PRIVATE void WTFGetBacktrace(void** stack, int* size); … … 433 428 #endif 434 429 435 /* LOG_WITH_LEVEL */436 437 #if LOG_DISABLED438 #define LOG_WITH_LEVEL(channel, level, ...) ((void)0)439 #else440 #define LOG_WITH_LEVEL(channel, level, ...) WTFLogWithLevel(&LOG_CHANNEL(channel), level, __VA_ARGS__)441 #endif442 443 430 /* RELEASE_LOG */ 444 431 … … 449 436 #define RELEASE_LOG_IF( isAllowed, channel, format, ...) ((void)0) 450 437 #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)454 438 #else 455 439 #define RELEASE_LOG( channel, format, ...) os_log( LOG_CHANNEL(channel).osLogChannel, format, ##__VA_ARGS__) … … 458 442 #define RELEASE_LOG_IF( isAllowed, channel, format, ...) do { if (isAllowed) RELEASE_LOG( channel, format, ##__VA_ARGS__); } while (0) 459 443 #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)470 444 #endif 471 445 -
trunk/Source/WTF/wtf/MemoryPressureHandler.cpp
r220938 r220947 35 35 36 36 #if RELEASE_LOG_DISABLED 37 WTFLogChannel LogMemoryPressure = { WTFLogChannelOn, "MemoryPressure" , WTFLogLevelError};37 WTFLogChannel LogMemoryPressure = { WTFLogChannelOn, "MemoryPressure" }; 38 38 #else 39 WTFLogChannel LogMemoryPressure = { WTFLogChannelOn, "MemoryPressure", WTFLogLevelError,LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };39 WTFLogChannel LogMemoryPressure = { WTFLogChannelOn, "MemoryPressure", LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT }; 40 40 #endif 41 41 -
trunk/Source/WTF/wtf/RefCountedLeakCounter.cpp
r220938 r220947 41 41 #define LOG_CHANNEL_PREFIX Log 42 42 #if RELEASE_LOG_DISABLED 43 static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn, "RefCountedLeaks" , WTFLogLevelError};43 static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn, "RefCountedLeaks" }; 44 44 #else 45 static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn, "RefCountedLeaks", WTFLogLevelError,LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };45 static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn, "RefCountedLeaks", LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT }; 46 46 #endif 47 47 -
trunk/Tools/ChangeLog
r220945 r220947 1 2017-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 1 13 2017-08-18 Devin Rousso <webkit@devinrousso.com> 2 14 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r220938 r220947 26 26 07492B3C1DF8B86600633DE1 /* enumerateMediaDevices.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 07492B391DF8ADA400633DE1 /* enumerateMediaDevices.html */; }; 27 27 074994421EA5034B000DA44E /* getUserMedia.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 4A410F4D19AF7BEF002EBAB5 /* getUserMedia.html */; }; 28 076E507F1F4513D6006E9F5A /* Logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 076E507E1F45031E006E9F5A /* Logging.cpp */; };29 28 0799C3491EBA2D7B003B7532 /* UserMediaDisabled.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07EDEFAC1EB9400C00D43292 /* UserMediaDisabled.mm */; }; 30 29 0799C34B1EBA3301003B7532 /* disableGetUserMedia.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 0799C34A1EBA32F4003B7532 /* disableGetUserMedia.html */; }; … … 992 991 07492B3A1DF8AE2D00633DE1 /* EnumerateMediaDevices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EnumerateMediaDevices.cpp; sourceTree = "<group>"; }; 993 992 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>"; };995 993 0799C34A1EBA32F4003B7532 /* disableGetUserMedia.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = disableGetUserMedia.html; sourceTree = "<group>"; }; 996 994 07C046C91E42573E007201E7 /* CARingBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CARingBuffer.cpp; sourceTree = "<group>"; }; … … 2033 2031 7A909A751D877475007E10F8 /* IntSize.cpp */, 2034 2032 14464012167A8305000BD218 /* LayoutUnit.cpp */, 2035 076E507E1F45031E006E9F5A /* Logging.cpp */,2036 2033 CD225C071C45A69200140761 /* ParsedContentRange.cpp */, 2037 2034 CDCFA7A91E45122F00C2433D /* SampleMap.cpp */, … … 3258 3255 7CCE7F0C1A411AE600447C4C /* PrivateBrowsingPushStateNoHistoryCallback.cpp in Sources */, 3259 3256 4647B1261EBA3B850041D7EF /* ProcessDidTerminate.cpp in Sources */, 3260 076E507F1F4513D6006E9F5A /* Logging.cpp in Sources */,3261 3257 7C83E0C11D0A652F00FEBCF3 /* ProvisionalURLNotChange.mm in Sources */, 3262 3258 7CCE7EC81A411A7E00447C4C /* PublicSuffix.mm in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.