Diff
Modified: trunk/Source/WTF/ChangeLog (243131 => 243132)
--- trunk/Source/WTF/ChangeLog 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WTF/ChangeLog 2019-03-19 06:36:11 UTC (rev 243132)
@@ -1,3 +1,23 @@
+2019-03-18 Alex Christensen <[email protected]>
+
+ Make WTFLogChannelState and WTFLogLevel enum classes
+ https://bugs.webkit.org/show_bug.cgi?id=195904
+
+ Reviewed by Eric Carlson.
+
+ * wtf/Assertions.cpp:
+ * wtf/Assertions.h:
+ * wtf/Logger.h:
+ (WTF::Logger::logAlways const):
+ (WTF::Logger::error const):
+ (WTF::Logger::warning const):
+ (WTF::Logger::info const):
+ (WTF::Logger::debug const):
+ (WTF::Logger::willLog const):
+ (WTF::Logger::log):
+ * wtf/MemoryPressureHandler.cpp:
+ * wtf/RefCountedLeakCounter.cpp:
+
2019-03-18 Darin Adler <[email protected]>
Cut down on use of StringBuffer, possibly leading toward removing it entirely
Modified: trunk/Source/WTF/wtf/AggregateLogger.h (243131 => 243132)
--- trunk/Source/WTF/wtf/AggregateLogger.h 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WTF/wtf/AggregateLogger.h 2019-03-19 06:36:11 UTC (rev 243132)
@@ -57,7 +57,7 @@
// on some systems, so don't allow it.
UNUSED_PARAM(channel);
#else
- log(channel, WTFLogLevelAlways, arguments...);
+ log(channel, WTFLogLevel::Always, arguments...);
#endif
}
@@ -64,25 +64,25 @@
template<typename... Arguments>
inline void error(WTFLogChannel& channel, const Arguments&... arguments) const
{
- log(channel, WTFLogLevelError, arguments...);
+ log(channel, WTFLogLevel::Error, arguments...);
}
template<typename... Arguments>
inline void warning(WTFLogChannel& channel, const Arguments&... arguments) const
{
- log(channel, WTFLogLevelWarning, arguments...);
+ log(channel, WTFLogLevel::Warning, arguments...);
}
template<typename... Arguments>
inline void info(WTFLogChannel& channel, const Arguments&... arguments) const
{
- log(channel, WTFLogLevelInfo, arguments...);
+ log(channel, WTFLogLevel::Info, arguments...);
}
template<typename... Arguments>
inline void debug(WTFLogChannel& channel, const Arguments&... arguments) const
{
- log(channel, WTFLogLevelDebug, arguments...);
+ log(channel, WTFLogLevel::Debug, arguments...);
}
inline bool willLog(const WTFLogChannel& channel, WTFLogLevel level) const
Modified: trunk/Source/WTF/wtf/Assertions.cpp (243131 => 243132)
--- trunk/Source/WTF/wtf/Assertions.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WTF/wtf/Assertions.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -409,15 +409,15 @@
bool WTFWillLogWithLevel(WTFLogChannel* channel, WTFLogLevel level)
{
- return channel->level >= level && channel->state != WTFLogChannelOff;
+ return channel->level >= level && channel->state != WTFLogChannelState::Off;
}
void WTFLogWithLevel(WTFLogChannel* channel, WTFLogLevel level, const char* format, ...)
{
- if (level != WTFLogLevelAlways && level > channel->level)
+ if (level != WTFLogLevel::Always && level > channel->level)
return;
- if (channel->level != WTFLogLevelAlways && channel->state == WTFLogChannelOff)
+ if (channel->level != WTFLogLevel::Always && channel->state == WTFLogChannelState::Off)
return;
va_list args;
@@ -432,15 +432,15 @@
static void WTFLogVaList(WTFLogChannel* channel, const char* format, va_list args)
{
- if (channel->state == WTFLogChannelOff)
+ if (channel->state == WTFLogChannelState::Off)
return;
- if (channel->state == WTFLogChannelOn) {
+ if (channel->state == WTFLogChannelState::On) {
vprintf_stderr_with_trailing_newline(format, args);
return;
}
- ASSERT(channel->state == WTFLogChannelOnWithAccumulation);
+ ASSERT(channel->state == WTFLogChannelState::OnWithAccumulation);
ALLOW_NONLITERAL_FORMAT_BEGIN
String loggingString = WTF::createWithFormatAndArguments(format, args);
@@ -466,7 +466,7 @@
void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChannel* channel, const char* format, ...)
{
- if (channel->state != WTFLogChannelOn)
+ if (channel->state != WTFLogChannelState::On)
return;
va_list args;
@@ -533,9 +533,9 @@
Vector<String> componentInfo = logLevelComponent.split('=');
String component = componentInfo[0].stripWhiteSpace();
- WTFLogChannelState logChannelState = WTFLogChannelOn;
+ WTFLogChannelState logChannelState = WTFLogChannelState::On;
if (component.startsWith('-')) {
- logChannelState = WTFLogChannelOff;
+ logChannelState = WTFLogChannelState::Off;
component = component.substring(1);
}
@@ -544,17 +544,17 @@
continue;
}
- WTFLogLevel logChannelLevel = WTFLogLevelError;
+ WTFLogLevel logChannelLevel = WTFLogLevel::Error;
if (componentInfo.size() > 1) {
String level = componentInfo[1].stripWhiteSpace();
if (equalLettersIgnoringASCIICase(level, "error"))
- logChannelLevel = WTFLogLevelError;
+ logChannelLevel = WTFLogLevel::Error;
else if (equalLettersIgnoringASCIICase(level, "warning"))
- logChannelLevel = WTFLogLevelWarning;
+ logChannelLevel = WTFLogLevel::Warning;
else if (equalLettersIgnoringASCIICase(level, "info"))
- logChannelLevel = WTFLogLevelInfo;
+ logChannelLevel = WTFLogLevel::Info;
else if (equalLettersIgnoringASCIICase(level, "debug"))
- logChannelLevel = WTFLogLevelDebug;
+ logChannelLevel = WTFLogLevel::Debug;
else
WTFLogAlways("Unknown logging level: %s", level.utf8().data());
}
Modified: trunk/Source/WTF/wtf/Assertions.h (243131 => 243132)
--- trunk/Source/WTF/wtf/Assertions.h 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WTF/wtf/Assertions.h 2019-03-19 06:36:11 UTC (rev 243132)
@@ -148,8 +148,13 @@
#define NO_RETURN_DUE_TO_CRASH
#endif
-typedef enum { WTFLogChannelOff, WTFLogChannelOn, WTFLogChannelOnWithAccumulation } WTFLogChannelState;
-typedef enum { WTFLogLevelAlways, WTFLogLevelError, WTFLogLevelWarning, WTFLogLevelInfo, WTFLogLevelDebug } WTFLogLevel;
+#ifdef __cplusplus
+enum class WTFLogChannelState : uint8_t { Off, On, OnWithAccumulation };
+enum class WTFLogLevel : uint8_t { Always, Error, Warning, Info, Debug };
+#else
+typedef uint8_t WTFLogChannelState;
+typedef uint8_t WTFLogLevel;
+#endif
typedef struct {
WTFLogChannelState state;
@@ -174,10 +179,10 @@
#if !defined(DEFINE_LOG_CHANNEL)
#if RELEASE_LOG_DISABLED
#define DEFINE_LOG_CHANNEL(name, subsystem) \
- WTFLogChannel LOG_CHANNEL(name) = { WTFLogChannelOff, #name, WTFLogLevelError };
+ WTFLogChannel LOG_CHANNEL(name) = { (WTFLogChannelState)0, #name, (WTFLogLevel)1 };
#else
#define DEFINE_LOG_CHANNEL(name, subsystem) \
- WTFLogChannel LOG_CHANNEL(name) = { WTFLogChannelOff, #name, WTFLogLevelError, subsystem, OS_LOG_DEFAULT };
+ WTFLogChannel LOG_CHANNEL(name) = { (WTFLogChannelState)0, #name, (WTFLogLevel)1, subsystem, OS_LOG_DEFAULT };
#endif
#endif
Modified: trunk/Source/WTF/wtf/Logger.h (243131 => 243132)
--- trunk/Source/WTF/wtf/Logger.h 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WTF/wtf/Logger.h 2019-03-19 06:36:11 UTC (rev 243132)
@@ -126,10 +126,10 @@
// on some systems, so don't allow it.
UNUSED_PARAM(channel);
#else
- if (!willLog(channel, WTFLogLevelAlways))
+ if (!willLog(channel, WTFLogLevel::Always))
return;
- log(channel, WTFLogLevelAlways, arguments...);
+ log(channel, WTFLogLevel::Always, arguments...);
#endif
}
@@ -136,37 +136,37 @@
template<typename... Arguments>
inline void error(WTFLogChannel& channel, const Arguments&... arguments) const
{
- if (!willLog(channel, WTFLogLevelError))
+ if (!willLog(channel, WTFLogLevel::Error))
return;
- log(channel, WTFLogLevelError, arguments...);
+ log(channel, WTFLogLevel::Error, arguments...);
}
template<typename... Arguments>
inline void warning(WTFLogChannel& channel, const Arguments&... arguments) const
{
- if (!willLog(channel, WTFLogLevelWarning))
+ if (!willLog(channel, WTFLogLevel::Warning))
return;
- log(channel, WTFLogLevelWarning, arguments...);
+ log(channel, WTFLogLevel::Warning, arguments...);
}
template<typename... Arguments>
inline void info(WTFLogChannel& channel, const Arguments&... arguments) const
{
- if (!willLog(channel, WTFLogLevelInfo))
+ if (!willLog(channel, WTFLogLevel::Info))
return;
- log(channel, WTFLogLevelInfo, arguments...);
+ log(channel, WTFLogLevel::Info, arguments...);
}
template<typename... Arguments>
inline void debug(WTFLogChannel& channel, const Arguments&... arguments) const
{
- if (!willLog(channel, WTFLogLevelDebug))
+ if (!willLog(channel, WTFLogLevel::Debug))
return;
- log(channel, WTFLogLevelDebug, arguments...);
+ log(channel, WTFLogLevel::Debug, arguments...);
}
inline bool willLog(const WTFLogChannel& channel, WTFLogLevel level) const
@@ -174,10 +174,10 @@
if (!m_enabled)
return false;
- if (level <= WTFLogLevelError)
+ if (level <= WTFLogLevel::Error)
return true;
- if (channel.state == WTFLogChannelOff || level > channel.level)
+ if (channel.state == WTFLogChannelState::Off || level > channel.level)
return false;
return m_enabled;
@@ -242,7 +242,7 @@
os_log(channel.osLogChannel, "%{public}s", logMessage.utf8().data());
#endif
- if (channel.state == WTFLogChannelOff || level > channel.level)
+ if (channel.state == WTFLogChannelState::Off || level > channel.level)
return;
for (Observer& observer : observers())
Modified: trunk/Source/WTF/wtf/MemoryPressureHandler.cpp (243131 => 243132)
--- trunk/Source/WTF/wtf/MemoryPressureHandler.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WTF/wtf/MemoryPressureHandler.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -35,9 +35,9 @@
namespace WTF {
#if RELEASE_LOG_DISABLED
-WTFLogChannel LogMemoryPressure = { WTFLogChannelOn, "MemoryPressure", WTFLogLevelError };
+WTFLogChannel LogMemoryPressure = { WTFLogChannelState::On, "MemoryPressure", WTFLogLevel::Error };
#else
-WTFLogChannel LogMemoryPressure = { WTFLogChannelOn, "MemoryPressure", WTFLogLevelError, LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
+WTFLogChannel LogMemoryPressure = { WTFLogChannelState::On, "MemoryPressure", WTFLogLevel::Error, LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
#endif
WTF_EXPORT_PRIVATE bool MemoryPressureHandler::ReliefLogger::s_loggingEnabled = false;
Modified: trunk/Source/WTF/wtf/RefCountedLeakCounter.cpp (243131 => 243132)
--- trunk/Source/WTF/wtf/RefCountedLeakCounter.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WTF/wtf/RefCountedLeakCounter.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -40,9 +40,9 @@
#define LOG_CHANNEL_PREFIX Log
#if RELEASE_LOG_DISABLED
-static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn, "RefCountedLeaks", WTFLogLevelError };
+static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelState::On, "RefCountedLeaks", WTFLogLevel::Error };
#else
-static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn, "RefCountedLeaks", WTFLogLevelError, LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
+static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelState::On, "RefCountedLeaks", WTFLogLevel::Error, LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
#endif
typedef HashCountedSet<const char*, PtrHash<const char*>> ReasonSet;
Modified: trunk/Source/WebCore/ChangeLog (243131 => 243132)
--- trunk/Source/WebCore/ChangeLog 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebCore/ChangeLog 2019-03-19 06:36:11 UTC (rev 243132)
@@ -1,3 +1,39 @@
+2019-03-18 Alex Christensen <[email protected]>
+
+ Make WTFLogChannelState and WTFLogLevel enum classes
+ https://bugs.webkit.org/show_bug.cgi?id=195904
+
+ Reviewed by Eric Carlson.
+
+ * Modules/mediasource/SourceBuffer.cpp:
+ (WebCore::removeSamplesFromTrackBuffer):
+ * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+ (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
+ (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
+ * dom/Document.cpp:
+ (WebCore::messageLevelFromWTFLogLevel):
+ * html/FTPDirectoryDocument.cpp:
+ (WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::seekTask):
+ (WebCore::HTMLMediaElement::selectNextSourceChild):
+ (WebCore::HTMLMediaElement::sourceWasAdded):
+ (WebCore::HTMLMediaElement::sourceWasRemoved):
+ * inspector/agents/WebConsoleAgent.cpp:
+ (WebCore::WebConsoleAgent::getLoggingChannels):
+ (WebCore::channelConfigurationForString):
+ * platform/Logging.cpp:
+ (WebCore::isLogChannelEnabled):
+ (WebCore::setLogChannelToAccumulate):
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
+ * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
+ (WebCore::initializePeerConnectionFactoryAndThreads):
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::compositingLogEnabled):
+
2019-03-18 Said Abou-Hallawa <[email protected]>
Remove the SVG property tear off objects for SVGStringList
Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (243131 => 243132)
--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -741,7 +741,7 @@
size_t bytesRemoved = 0;
auto logIdentifier = WTF::Logger::LogSiteIdentifier(buffer->logClassName(), logPrefix, buffer->logIdentifier());
auto& logger = buffer->logger();
- auto willLog = logger.willLog(buffer->logChannel(), WTFLogLevelDebug);
+ auto willLog = logger.willLog(buffer->logChannel(), WTFLogLevel::Debug);
#else
UNUSED_PARAM(logPrefix);
UNUSED_PARAM(buffer);
Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp (243131 => 243132)
--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -865,7 +865,7 @@
}
for (auto iterator = report->begin(); iterator != report->end(); ++iterator) {
- if (logger().willLog(logChannel(), WTFLogLevelDebug)) {
+ if (logger().willLog(logChannel(), WTFLogLevel::Debug)) {
// Stats are very verbose, let's only display them in inspector console in verbose mode.
logger().debug(LogWebRTC,
Logger::LogSiteIdentifier("LibWebRTCMediaEndpoint", "OnStatsDelivered", logIdentifier()),
@@ -904,7 +904,7 @@
Seconds LibWebRTCMediaEndpoint::statsLogInterval(int64_t reportTimestamp) const
{
- if (logger().willLog(logChannel(), WTFLogLevelInfo))
+ if (logger().willLog(logChannel(), WTFLogLevel::Info))
return 2_s;
if (reportTimestamp - m_statsFirstDeliveredTimestamp > 15000000)
Modified: trunk/Source/WebCore/dom/Document.cpp (243131 => 243132)
--- trunk/Source/WebCore/dom/Document.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebCore/dom/Document.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -8538,18 +8538,18 @@
static MessageLevel messageLevelFromWTFLogLevel(WTFLogLevel level)
{
switch (level) {
- case WTFLogLevelAlways:
+ case WTFLogLevel::Always:
return MessageLevel::Log;
- case WTFLogLevelError:
+ case WTFLogLevel::Error:
return MessageLevel::Error;
break;
- case WTFLogLevelWarning:
+ case WTFLogLevel::Warning:
return MessageLevel::Warning;
break;
- case WTFLogLevelInfo:
+ case WTFLogLevel::Info:
return MessageLevel::Info;
break;
- case WTFLogLevelDebug:
+ case WTFLogLevel::Debug:
return MessageLevel::Debug;
break;
}
Modified: trunk/Source/WebCore/html/FTPDirectoryDocument.cpp (243131 => 243132)
--- trunk/Source/WebCore/html/FTPDirectoryDocument.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebCore/html/FTPDirectoryDocument.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -425,7 +425,7 @@
: HTMLDocument(frame, url)
{
#if !LOG_DISABLED
- LogFTP.state = WTFLogChannelOn;
+ LogFTP.state = WTFLogChannelState::On;
#endif
}
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (243131 => 243132)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -3075,7 +3075,7 @@
// time scale, we will ask the media engine to "seek" to the current movie time, which may be a noop and
// not generate a timechanged callback. This means m_seeking will never be cleared and we will never
// fire a 'seeked' event.
- if (willLog(WTFLogLevelDebug)) {
+ if (willLog(WTFLogLevel::Debug)) {
MediaTime mediaTime = m_player->mediaTimeForTimeValue(time);
if (time != mediaTime)
INFO_LOG(LOGIDENTIFIER, time, " media timeline equivalent is ", mediaTime);
@@ -4651,7 +4651,7 @@
UNUSED_PARAM(keySystem);
// Don't log if this was just called to find out if there are any valid <source> elements.
- bool shouldLog = willLog(WTFLogLevelDebug) && actionIfInvalid != DoNothing;
+ bool shouldLog = willLog(WTFLogLevel::Debug) && actionIfInvalid != DoNothing;
if (shouldLog)
INFO_LOG(LOGIDENTIFIER);
@@ -4750,7 +4750,7 @@
void HTMLMediaElement::sourceWasAdded(HTMLSourceElement& source)
{
- if (willLog(WTFLogLevelInfo) && source.hasTagName(sourceTag)) {
+ if (willLog(WTFLogLevel::Info) && source.hasTagName(sourceTag)) {
URL url = ""
INFO_LOG(LOGIDENTIFIER, "'src' is ", url);
}
@@ -4802,7 +4802,7 @@
void HTMLMediaElement::sourceWasRemoved(HTMLSourceElement& source)
{
- if (willLog(WTFLogLevelInfo) && source.hasTagName(sourceTag)) {
+ if (willLog(WTFLogLevel::Info) && source.hasTagName(sourceTag)) {
URL url = ""
INFO_LOG(LOGIDENTIFIER, "'src' is ", url);
}
Modified: trunk/Source/WebCore/inspector/agents/WebConsoleAgent.cpp (243131 => 243132)
--- trunk/Source/WebCore/inspector/agents/WebConsoleAgent.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebCore/inspector/agents/WebConsoleAgent.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -68,15 +68,15 @@
return;
auto level = Inspector::Protocol::Console::ChannelLevel::Off;
- if (logChannel->state != WTFLogChannelOff) {
+ if (logChannel->state != WTFLogChannelState::Off) {
switch (logChannel->level) {
- case WTFLogLevelAlways:
- case WTFLogLevelError:
- case WTFLogLevelWarning:
- case WTFLogLevelInfo:
+ case WTFLogLevel::Always:
+ case WTFLogLevel::Error:
+ case WTFLogLevel::Warning:
+ case WTFLogLevel::Info:
level = Inspector::Protocol::Console::ChannelLevel::Basic;
break;
- case WTFLogLevelDebug:
+ case WTFLogLevel::Debug:
level = Inspector::Protocol::Console::ChannelLevel::Verbose;
break;
}
@@ -96,14 +96,14 @@
WTFLogLevel level;
if (equalIgnoringASCIICase(levelString, "off")) {
- state = WTFLogChannelOff;
- level = WTFLogLevelError;
+ state = WTFLogChannelState::Off;
+ level = WTFLogLevel::Error;
} else {
- state = WTFLogChannelOn;
+ state = WTFLogChannelState::On;
if (equalIgnoringASCIICase(levelString, "basic"))
- level = WTFLogLevelWarning;
+ level = WTFLogLevel::Warning;
else if (equalIgnoringASCIICase(levelString, "verbose"))
- level = WTFLogLevelDebug;
+ level = WTFLogLevel::Debug;
else
return WTF::nullopt;
}
Modified: trunk/Source/WebCore/platform/Logging.cpp (243131 => 243132)
--- trunk/Source/WebCore/platform/Logging.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebCore/platform/Logging.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -54,7 +54,7 @@
WTFLogChannel* channel = WTFLogChannelByName(logChannels, logChannelCount, name.utf8().data());
if (!channel)
return false;
- return channel->state != WTFLogChannelOff;
+ return channel->state != WTFLogChannelState::Off;
}
static bool logChannelsNeedInitialization = true;
@@ -65,7 +65,7 @@
if (!channel)
return;
- channel->state = WTFLogChannelOnWithAccumulation;
+ channel->state = WTFLogChannelState::OnWithAccumulation;
logChannelsNeedInitialization = true;
}
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (243131 => 243132)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2019-03-19 06:36:11 UTC (rev 243132)
@@ -3551,7 +3551,7 @@
}
#if !RELEASE_LOG_DISABLED
- if (player->logger().willLog(player->logChannel(), WTFLogLevelDebug) && !([keyPath isEqualToString:@"loadedTimeRanges"] || [keyPath isEqualToString:@"seekableTimeRanges"])) {
+ if (player->logger().willLog(player->logChannel(), WTFLogLevel::Debug) && !([keyPath isEqualToString:@"loadedTimeRanges"] || [keyPath isEqualToString:@"seekableTimeRanges"])) {
auto identifier = Logger::LogSiteIdentifier("MediaPlayerPrivateAVFoundation", "observeValueForKeyPath", player->logIdentifier());
if (shouldLogValue) {
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm (243131 => 243132)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm 2019-03-19 06:36:11 UTC (rev 243132)
@@ -385,7 +385,7 @@
sample.offsetTimestampsBy(timelineOffset);
DEBUG_LOG(LOGIDENTIFIER, "updated sample = ", sample);
- if (WILL_LOG(WTFLogLevelDebug)) {
+ if (WILL_LOG(WTFLogLevel::Debug)) {
MediaTime now = streamTime();
double delta = (sample.presentationTime() - now).toDouble();
if (delta < 0)
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp (243131 => 243132)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -34,7 +34,7 @@
static inline bool compositingLogEnabled()
{
#if !LOG_DISABLED
- return LogCompositing.state == WTFLogChannelOn;
+ return LogCompositing.state == WTFLogChannelState::On;
#else
return false;
#endif
Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp (243131 => 243132)
--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -142,18 +142,18 @@
{
#if defined(NDEBUG)
#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
- if (LogWebRTC.state != WTFLogChannelOn)
+ if (LogWebRTC.state != WTFLogChannelState::On)
return rtc::LS_ERROR;
switch (LogWebRTC.level) {
- case WTFLogLevelAlways:
- case WTFLogLevelError:
+ case WTFLogLevel::Always:
+ case WTFLogLevel::Error:
return rtc::LS_ERROR;
- case WTFLogLevelWarning:
+ case WTFLogLevel::Warning:
return rtc::LS_WARNING;
- case WTFLogLevelInfo:
+ case WTFLogLevel::Info:
return rtc::LS_INFO;
- case WTFLogLevelDebug:
+ case WTFLogLevel::Debug:
return rtc::LS_VERBOSE;
}
#else
@@ -160,7 +160,7 @@
return rtc::LS_NONE;
#endif
#else
- return (LogWebRTC.state != WTFLogChannelOn) ? rtc::LS_WARNING : rtc::LS_INFO;
+ return (LogWebRTC.state != WTFLogChannelState::On) ? rtc::LS_WARNING : rtc::LS_INFO;
#endif
}
Modified: trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm (243131 => 243132)
--- trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm 2019-03-19 06:36:11 UTC (rev 243132)
@@ -745,7 +745,7 @@
bool willChange = [[change valueForKey:NSKeyValueChangeNotificationIsPriorKey] boolValue];
#if !RELEASE_LOG_DISABLED
- if (m_callback->loggerPtr() && m_callback->logger().willLog(m_callback->logChannel(), WTFLogLevelDebug)) {
+ if (m_callback->loggerPtr() && m_callback->logger().willLog(m_callback->logChannel(), WTFLogLevel::Debug)) {
auto identifier = Logger::LogSiteIdentifier("AVVideoCaptureSource", "observeValueForKeyPath", m_callback->logIdentifier());
RetainPtr<NSString> valueString = adoptNS([[NSString alloc] initWithFormat:@"%@", newValue]);
Modified: trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp (243131 => 243132)
--- trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -156,7 +156,7 @@
void SoupNetworkSession::setupLogger()
{
#if !LOG_DISABLED
- if (LogNetwork.state != WTFLogChannelOn || soup_session_get_feature(m_soupSession.get(), SOUP_TYPE_LOGGER))
+ if (LogNetwork.state != WTFLogChannelState::On || soup_session_get_feature(m_soupSession.get(), SOUP_TYPE_LOGGER))
return;
GRefPtr<SoupLogger> logger = adoptGRef(soup_logger_new(SOUP_LOGGER_LOG_BODY, -1));
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (243131 => 243132)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -273,7 +273,7 @@
#if !LOG_DISABLED
static inline bool compositingLogEnabled()
{
- return LogCompositing.state == WTFLogChannelOn;
+ return LogCompositing.state == WTFLogChannelState::On;
}
#endif
Modified: trunk/Source/WebKit/ChangeLog (243131 => 243132)
--- trunk/Source/WebKit/ChangeLog 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebKit/ChangeLog 2019-03-19 06:36:11 UTC (rev 243132)
@@ -1,3 +1,15 @@
+2019-03-18 Alex Christensen <[email protected]>
+
+ Make WTFLogChannelState and WTFLogLevel enum classes
+ https://bugs.webkit.org/show_bug.cgi?id=195904
+
+ Reviewed by Eric Carlson.
+
+ * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
+ (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
+ * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
+ (WebKit::NetworkRTCProvider::NetworkRTCProvider):
+
2019-03-18 Commit Queue <[email protected]>
Unreviewed, rolling out r243092 and r243096.
Modified: trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp (243131 => 243132)
--- trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -67,7 +67,7 @@
static void logSpeculativeLoadingDiagnosticMessage(NetworkProcess& networkProcess, const GlobalFrameID& frameID, const String& message)
{
#if !LOG_DISABLED
- if (WebKit2LogNetworkCacheSpeculativePreloading.state == WTFLogChannelOn)
+ if (WebKit2LogNetworkCacheSpeculativePreloading.state == WTFLogChannelState::On)
allSpeculativeLoadingDiagnosticMessages().add(message);
#endif
networkProcess.logDiagnosticMessage(frameID.first, WebCore::DiagnosticLoggingKeys::networkCacheKey(), message, WebCore::ShouldSample::Yes);
Modified: trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp (243131 => 243132)
--- trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -65,7 +65,7 @@
#if defined(NDEBUG)
rtc::LogMessage::LogToDebug(rtc::LS_NONE);
#else
- if (WebKit2LogWebRTC.state != WTFLogChannelOn)
+ if (WebKit2LogWebRTC.state != WTFLogChannelState::On)
rtc::LogMessage::LogToDebug(rtc::LS_WARNING);
#endif
}
Modified: trunk/Tools/ChangeLog (243131 => 243132)
--- trunk/Tools/ChangeLog 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Tools/ChangeLog 2019-03-19 06:36:11 UTC (rev 243132)
@@ -1,5 +1,15 @@
2019-03-18 Alex Christensen <[email protected]>
+ Make WTFLogChannelState and WTFLogLevel enum classes
+ https://bugs.webkit.org/show_bug.cgi?id=195904
+
+ Reviewed by Eric Carlson.
+
+ * TestWebKitAPI/Tests/WebCore/Logging.cpp:
+ (TestWebKitAPI::TEST_F):
+
+2019-03-18 Alex Christensen <[email protected]>
+
Disable flaky test added in r2431100
https://webkit.org/b/195785
Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/Logging.cpp (243131 => 243132)
--- trunk/Tools/TestWebKitAPI/Tests/WebCore/Logging.cpp 2019-03-19 05:46:42 UTC (rev 243131)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/Logging.cpp 2019-03-19 06:36:11 UTC (rev 243132)
@@ -72,10 +72,10 @@
m_stderr = fdopen(m_descriptors[0], "r");
WTFInitializeLogChannelStatesFromString(testLogChannels, logChannelCount, "all");
- WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelError);
- WTFSetLogChannelLevel(&TestChannel2, WTFLogLevelError);
- WTFSetLogChannelLevel(&TestChannel3, WTFLogLevelError);
- WTFSetLogChannelLevel(&TestChannel4, WTFLogLevelError);
+ WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Error);
+ WTFSetLogChannelLevel(&TestChannel2, WTFLogLevel::Error);
+ WTFSetLogChannelLevel(&TestChannel3, WTFLogLevel::Error);
+ WTFSetLogChannelLevel(&TestChannel4, WTFLogLevel::Error);
}
void TearDown() override
@@ -110,86 +110,86 @@
TEST_F(LoggingTest, Initialization)
{
- EXPECT_EQ(TestChannel1.state, WTFLogChannelOn);
- EXPECT_EQ(TestChannel2.state, WTFLogChannelOn);
- EXPECT_EQ(TestChannel3.state, WTFLogChannelOn);
- EXPECT_EQ(TestChannel4.state, WTFLogChannelOn);
+ EXPECT_EQ(TestChannel1.state, WTFLogChannelState::On);
+ EXPECT_EQ(TestChannel2.state, WTFLogChannelState::On);
+ EXPECT_EQ(TestChannel3.state, WTFLogChannelState::On);
+ EXPECT_EQ(TestChannel4.state, WTFLogChannelState::On);
- EXPECT_EQ(TestChannel1.level, WTFLogLevelError);
- EXPECT_EQ(TestChannel2.level, WTFLogLevelError);
- EXPECT_EQ(TestChannel3.level, WTFLogLevelError);
- EXPECT_EQ(TestChannel4.level, WTFLogLevelError);
+ EXPECT_EQ(TestChannel1.level, WTFLogLevel::Error);
+ EXPECT_EQ(TestChannel2.level, WTFLogLevel::Error);
+ EXPECT_EQ(TestChannel3.level, WTFLogLevel::Error);
+ EXPECT_EQ(TestChannel4.level, WTFLogLevel::Error);
- TestChannel1.state = WTFLogChannelOff;
+ TestChannel1.state = WTFLogChannelState::Off;
WTFInitializeLogChannelStatesFromString(testLogChannels, logChannelCount, "Channel1");
- EXPECT_EQ(TestChannel1.level, WTFLogLevelError);
- EXPECT_EQ(TestChannel1.state, WTFLogChannelOn);
+ EXPECT_EQ(TestChannel1.level, WTFLogLevel::Error);
+ EXPECT_EQ(TestChannel1.state, WTFLogChannelState::On);
- TestChannel1.state = WTFLogChannelOff;
+ TestChannel1.state = WTFLogChannelState::Off;
WTFInitializeLogChannelStatesFromString(testLogChannels, logChannelCount, "Channel1=foo");
- EXPECT_EQ(TestChannel1.level, WTFLogLevelError);
+ EXPECT_EQ(TestChannel1.level, WTFLogLevel::Error);
#if TEST_OUTPUT
EXPECT_TRUE(output().contains("Unknown logging level: foo", false));
#endif
WTFInitializeLogChannelStatesFromString(testLogChannels, logChannelCount, "Channel1=warning");
- EXPECT_EQ(TestChannel1.level, WTFLogLevelWarning);
- EXPECT_EQ(TestChannel2.level, WTFLogLevelError);
- EXPECT_EQ(TestChannel3.level, WTFLogLevelError);
- EXPECT_EQ(TestChannel4.level, WTFLogLevelError);
+ EXPECT_EQ(TestChannel1.level, WTFLogLevel::Warning);
+ EXPECT_EQ(TestChannel2.level, WTFLogLevel::Error);
+ EXPECT_EQ(TestChannel3.level, WTFLogLevel::Error);
+ EXPECT_EQ(TestChannel4.level, WTFLogLevel::Error);
WTFInitializeLogChannelStatesFromString(testLogChannels, logChannelCount, "Channel4= debug, Channel3 = info,Channel2=error");
- EXPECT_EQ(TestChannel1.level, WTFLogLevelWarning);
- EXPECT_EQ(TestChannel2.level, WTFLogLevelError);
- EXPECT_EQ(TestChannel3.level, WTFLogLevelInfo);
- EXPECT_EQ(TestChannel4.level, WTFLogLevelDebug);
+ EXPECT_EQ(TestChannel1.level, WTFLogLevel::Warning);
+ EXPECT_EQ(TestChannel2.level, WTFLogLevel::Error);
+ EXPECT_EQ(TestChannel3.level, WTFLogLevel::Info);
+ EXPECT_EQ(TestChannel4.level, WTFLogLevel::Debug);
WTFInitializeLogChannelStatesFromString(testLogChannels, logChannelCount, "-all");
- EXPECT_EQ(TestChannel1.state, WTFLogChannelOff);
- EXPECT_EQ(TestChannel2.state, WTFLogChannelOff);
- EXPECT_EQ(TestChannel3.state, WTFLogChannelOff);
- EXPECT_EQ(TestChannel4.state, WTFLogChannelOff);
+ EXPECT_EQ(TestChannel1.state, WTFLogChannelState::Off);
+ EXPECT_EQ(TestChannel2.state, WTFLogChannelState::Off);
+ EXPECT_EQ(TestChannel3.state, WTFLogChannelState::Off);
+ EXPECT_EQ(TestChannel4.state, WTFLogChannelState::Off);
WTFInitializeLogChannelStatesFromString(testLogChannels, logChannelCount, "all");
- EXPECT_EQ(TestChannel1.state, WTFLogChannelOn);
- EXPECT_EQ(TestChannel2.state, WTFLogChannelOn);
- EXPECT_EQ(TestChannel3.state, WTFLogChannelOn);
- EXPECT_EQ(TestChannel4.state, WTFLogChannelOn);
+ EXPECT_EQ(TestChannel1.state, WTFLogChannelState::On);
+ EXPECT_EQ(TestChannel2.state, WTFLogChannelState::On);
+ EXPECT_EQ(TestChannel3.state, WTFLogChannelState::On);
+ EXPECT_EQ(TestChannel4.state, WTFLogChannelState::On);
}
TEST_F(LoggingTest, WTFWillLogWithLevel)
{
- EXPECT_EQ(TestChannel1.state, WTFLogChannelOn);
- EXPECT_EQ(TestChannel2.state, WTFLogChannelOn);
- EXPECT_EQ(TestChannel3.state, WTFLogChannelOn);
- EXPECT_EQ(TestChannel4.state, WTFLogChannelOn);
+ EXPECT_EQ(TestChannel1.state, WTFLogChannelState::On);
+ EXPECT_EQ(TestChannel2.state, WTFLogChannelState::On);
+ EXPECT_EQ(TestChannel3.state, WTFLogChannelState::On);
+ EXPECT_EQ(TestChannel4.state, WTFLogChannelState::On);
- EXPECT_EQ(TestChannel1.level, WTFLogLevelError);
- EXPECT_EQ(TestChannel2.level, WTFLogLevelError);
- EXPECT_EQ(TestChannel3.level, WTFLogLevelError);
- EXPECT_EQ(TestChannel4.level, WTFLogLevelError);
+ EXPECT_EQ(TestChannel1.level, WTFLogLevel::Error);
+ EXPECT_EQ(TestChannel2.level, WTFLogLevel::Error);
+ EXPECT_EQ(TestChannel3.level, WTFLogLevel::Error);
+ EXPECT_EQ(TestChannel4.level, WTFLogLevel::Error);
- EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelError));
- EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel2, WTFLogLevelError));
- EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel3, WTFLogLevelError));
- EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel4, WTFLogLevelError));
+ EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Error));
+ EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel2, WTFLogLevel::Error));
+ EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel3, WTFLogLevel::Error));
+ EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel4, WTFLogLevel::Error));
- EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelInfo));
- EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel2, WTFLogLevelInfo));
- EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel3, WTFLogLevelInfo));
- EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel4, WTFLogLevelInfo));
+ EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Info));
+ EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel2, WTFLogLevel::Info));
+ EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel3, WTFLogLevel::Info));
+ EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel4, WTFLogLevel::Info));
- TestChannel1.state = WTFLogChannelOff;
- EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelError));
- EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelInfo));
+ TestChannel1.state = WTFLogChannelState::Off;
+ EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Error));
+ EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Info));
- TestChannel1.state = WTFLogChannelOn;
- EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelError));
- EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelInfo));
+ TestChannel1.state = WTFLogChannelState::On;
+ EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Error));
+ EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Info));
- TestChannel1.level = WTFLogLevelInfo;
- EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelError));
- EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelInfo));
+ TestChannel1.level = WTFLogLevel::Info;
+ EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Error));
+ EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Info));
}
#if TEST_OUTPUT
@@ -201,21 +201,21 @@
TEST_F(LoggingTest, LOG_WITH_LEVEL)
{
- LOG_WITH_LEVEL(Channel1, WTFLogLevelError, "Go and boil your bottoms, you sons of a silly person.");
+ LOG_WITH_LEVEL(Channel1, WTFLogLevel::Error, "Go and boil your bottoms, you sons of a silly person.");
EXPECT_TRUE(output().contains("sons of a silly person.", false));
- LOG_WITH_LEVEL(Channel1, WTFLogLevelWarning, "You don't frighten us, English pig dogs.");
+ LOG_WITH_LEVEL(Channel1, WTFLogLevel::Warning, "You don't frighten us, English pig dogs.");
EXPECT_EQ(0u, output().length());
- WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelInfo);
- LOG_WITH_LEVEL(Channel1, WTFLogLevelWarning, "I'm French. Why do you think I have this outrageous accent, you silly king?");
+ WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Info);
+ LOG_WITH_LEVEL(Channel1, WTFLogLevel::Warning, "I'm French. Why do you think I have this outrageous accent, you silly king?");
EXPECT_TRUE(output().contains("outrageous accent", false));
- LOG_WITH_LEVEL(Channel1, WTFLogLevelDebug, "You don't frighten us with your silly knees-bent running around advancing behavior!");
+ LOG_WITH_LEVEL(Channel1, WTFLogLevel::Debug, "You don't frighten us with your silly knees-bent running around advancing behavior!");
EXPECT_EQ(0u, output().length());
- WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelDebug);
- LOG_WITH_LEVEL(Channel1, WTFLogLevelDebug, "Go and tell your master that we have been charged by God with a sacred quest.");
+ WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Debug);
+ LOG_WITH_LEVEL(Channel1, WTFLogLevel::Debug, "Go and tell your master that we have been charged by God with a sacred quest.");
EXPECT_TRUE(output().contains("sacred quest", false));
}
@@ -238,21 +238,21 @@
TEST_F(LoggingTest, RELEASE_LOG_WITH_LEVEL)
{
- RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevelError, "You don't frighten us, English pig dogs.");
+ RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevel::Error, "You don't frighten us, English pig dogs.");
EXPECT_TRUE(output().contains("pig dogs.", false));
- RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevelWarning, "Go and boil your bottoms, you sons of a silly person.");
+ RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevel::Warning, "Go and boil your bottoms, you sons of a silly person.");
EXPECT_EQ(0u, output().length());
- WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelInfo);
- RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevelWarning, "I'm French. Why do you think I have this outrageous accent, you silly king?");
+ WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Info);
+ RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevel::Warning, "I'm French. Why do you think I have this outrageous accent, you silly king?");
EXPECT_TRUE(output().contains("outrageous accent", false));
- RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevelDebug, "You don't frighten us with your silly knees-bent running around advancing behavior!");
+ RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevel::Debug, "You don't frighten us with your silly knees-bent running around advancing behavior!");
EXPECT_EQ(0u, output().length());
- WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelDebug);
- RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevelDebug, "Go and tell your master that we have been charged by God with a sacred quest.");
+ WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Debug);
+ RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevel::Debug, "Go and tell your master that we have been charged by God with a sacred quest.");
EXPECT_TRUE(output().contains("sacred quest", false));
}
@@ -259,14 +259,14 @@
TEST_F(LoggingTest, RELEASE_LOG_WITH_LEVEL_IF)
{
bool enabled = true;
- RELEASE_LOG_WITH_LEVEL_IF(enabled, Channel1, WTFLogLevelError, "Is there someone else up there that we can talk to?");
+ RELEASE_LOG_WITH_LEVEL_IF(enabled, Channel1, WTFLogLevel::Error, "Is there someone else up there that we can talk to?");
EXPECT_TRUE(output().contains("someone else", false));
- RELEASE_LOG_WITH_LEVEL_IF(enabled, Channel1, WTFLogLevelDebug, "No, now go away");
+ RELEASE_LOG_WITH_LEVEL_IF(enabled, Channel1, WTFLogLevel::Debug, "No, now go away");
EXPECT_EQ(0u, output().length());
enabled = false;
- RELEASE_LOG_WITH_LEVEL_IF(enabled, Channel1, WTFLogLevelWarning, "or I shall taunt you a second time! %i", 12);
+ RELEASE_LOG_WITH_LEVEL_IF(enabled, Channel1, WTFLogLevel::Warning, "or I shall taunt you a second time! %i", 12);
EXPECT_EQ(0u, output().length());
}
@@ -275,8 +275,8 @@
Ref<Logger> logger = Logger::create(this);
EXPECT_TRUE(logger->enabled());
- WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelError);
- EXPECT_TRUE(logger->willLog(TestChannel1, WTFLogLevelError));
+ WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Error);
+ EXPECT_TRUE(logger->willLog(TestChannel1, WTFLogLevel::Error));
logger->error(TestChannel1, "You're using coconuts!");
EXPECT_TRUE(output().contains("You're using coconuts!", false));
logger->warning(TestChannel1, "You're using coconuts!");
@@ -305,15 +305,15 @@
logger->error(TestChannel1, "You've got ", 2, " empty halves of ", "coconuts!");
EXPECT_TRUE(output().contains("You've got 2 empty halves of coconuts!", false));
- WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelError);
+ WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Error);
logger->logAlways(TestChannel1, "I shall taunt you a second time!");
EXPECT_TRUE(output().contains("I shall taunt you a second time!", false));
logger->setEnabled(this, false);
- EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevelError));
- EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevelWarning));
- EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevelInfo));
- EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevelDebug));
+ EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevel::Error));
+ EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevel::Warning));
+ EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevel::Info));
+ EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevel::Debug));
EXPECT_FALSE(logger->enabled());
logger->logAlways(TestChannel1, "You've got two empty halves of coconuts");
EXPECT_EQ(0u, output().length());
@@ -348,7 +348,7 @@
EXPECT_TRUE(result.contains(signature, false));
EXPECT_TRUE(result.contains("to the show that never", false));
- WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelWarning);
+ WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Warning);
ERROR_LOG(LOGIDENTIFIER, "We're so glad you could attend");
EXPECT_TRUE(output().contains("We're so glad you could attend", false));
@@ -388,7 +388,7 @@
StringBuilder m_logBuffer;
WTFLogChannel m_lastChannel;
- WTFLogLevel m_lastLevel { WTFLogLevelError };
+ WTFLogLevel m_lastLevel { WTFLogLevel::Error };
};
#if !RELEASE_LOG_DISABLED
@@ -403,7 +403,7 @@
EXPECT_TRUE(this->output().contains("testing 1, 2, 3", false));
EXPECT_TRUE(observer.log().contains("testing 1, 2, 3", false));
EXPECT_STREQ(observer.channel().name, logChannel().name);
- EXPECT_EQ(static_cast<int>(WTFLogLevelAlways), static_cast<int>(observer.level()));
+ EXPECT_EQ(static_cast<int>(WTFLogLevel::Always), static_cast<int>(observer.level()));
logger().removeObserver(observer);
ALWAYS_LOG("testing ", 1, ", ", 2, ", 3");