Changeset 243141 in webkit


Ignore:
Timestamp:
Mar 19, 2019 9:47:04 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Make WTFLogChannelState and WTFLogLevel enum classes
https://bugs.webkit.org/show_bug.cgi?id=195904

Patch by Alex Christensen <achristensen@webkit.org> on 2019-03-19
Reviewed by Eric Carlson.

Source/WebCore:

  • 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):

Source/WebKit:

  • NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:

(WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):

  • NetworkProcess/webrtc/NetworkRTCProvider.cpp:

(WebKit::NetworkRTCProvider::NetworkRTCProvider):

Source/WTF:

  • 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:

Tools:

  • TestWebKitAPI/Tests/WebCore/Logging.cpp:

(TestWebKitAPI::TEST_F):

Location:
trunk
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r243135 r243141  
     12019-03-19  Alex Christensen  <achristensen@webkit.org>
     2
     3        Make WTFLogChannelState and WTFLogLevel enum classes
     4        https://bugs.webkit.org/show_bug.cgi?id=195904
     5
     6        Reviewed by Eric Carlson.
     7
     8        * wtf/Assertions.cpp:
     9        * wtf/Assertions.h:
     10        * wtf/Logger.h:
     11        (WTF::Logger::logAlways const):
     12        (WTF::Logger::error const):
     13        (WTF::Logger::warning const):
     14        (WTF::Logger::info const):
     15        (WTF::Logger::debug const):
     16        (WTF::Logger::willLog const):
     17        (WTF::Logger::log):
     18        * wtf/MemoryPressureHandler.cpp:
     19        * wtf/RefCountedLeakCounter.cpp:
     20
    1212019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
    222
  • trunk/Source/WTF/wtf/AggregateLogger.h

    r243135 r243141  
    5858        UNUSED_PARAM(channel);
    5959#else
    60         log(channel, WTFLogLevelAlways, arguments...);
     60        log(channel, WTFLogLevel::Always, arguments...);
    6161#endif
    6262    }
     
    6565    inline void error(WTFLogChannel& channel, const Arguments&... arguments) const
    6666    {
    67         log(channel, WTFLogLevelError, arguments...);
     67        log(channel, WTFLogLevel::Error, arguments...);
    6868    }
    6969
     
    7171    inline void warning(WTFLogChannel& channel, const Arguments&... arguments) const
    7272    {
    73         log(channel, WTFLogLevelWarning, arguments...);
     73        log(channel, WTFLogLevel::Warning, arguments...);
    7474    }
    7575
     
    7777    inline void info(WTFLogChannel& channel, const Arguments&... arguments) const
    7878    {
    79         log(channel, WTFLogLevelInfo, arguments...);
     79        log(channel, WTFLogLevel::Info, arguments...);
    8080    }
    8181
     
    8383    inline void debug(WTFLogChannel& channel, const Arguments&... arguments) const
    8484    {
    85         log(channel, WTFLogLevelDebug, arguments...);
     85        log(channel, WTFLogLevel::Debug, arguments...);
    8686    }
    8787
  • trunk/Source/WTF/wtf/Assertions.cpp

    r243135 r243141  
    410410bool WTFWillLogWithLevel(WTFLogChannel* channel, WTFLogLevel level)
    411411{
    412     return channel->level >= level && channel->state != WTFLogChannelOff;
     412    return channel->level >= level && channel->state != WTFLogChannelState::Off;
    413413}
    414414
    415415void WTFLogWithLevel(WTFLogChannel* channel, WTFLogLevel level, const char* format, ...)
    416416{
    417     if (level != WTFLogLevelAlways && level > channel->level)
     417    if (level != WTFLogLevel::Always && level > channel->level)
    418418        return;
    419419
    420     if (channel->level != WTFLogLevelAlways && channel->state == WTFLogChannelOff)
     420    if (channel->level != WTFLogLevel::Always && channel->state == WTFLogChannelState::Off)
    421421        return;
    422422
     
    433433static void WTFLogVaList(WTFLogChannel* channel, const char* format, va_list args)
    434434{
    435     if (channel->state == WTFLogChannelOff)
     435    if (channel->state == WTFLogChannelState::Off)
    436436        return;
    437437
    438     if (channel->state == WTFLogChannelOn) {
     438    if (channel->state == WTFLogChannelState::On) {
    439439        vprintf_stderr_with_trailing_newline(format, args);
    440440        return;
    441441    }
    442442
    443     ASSERT(channel->state == WTFLogChannelOnWithAccumulation);
     443    ASSERT(channel->state == WTFLogChannelState::OnWithAccumulation);
    444444
    445445    ALLOW_NONLITERAL_FORMAT_BEGIN
     
    467467void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChannel* channel, const char* format, ...)
    468468{
    469     if (channel->state != WTFLogChannelOn)
     469    if (channel->state != WTFLogChannelState::On)
    470470        return;
    471471
     
    534534        String component = componentInfo[0].stripWhiteSpace();
    535535
    536         WTFLogChannelState logChannelState = WTFLogChannelOn;
     536        WTFLogChannelState logChannelState = WTFLogChannelState::On;
    537537        if (component.startsWith('-')) {
    538             logChannelState = WTFLogChannelOff;
     538            logChannelState = WTFLogChannelState::Off;
    539539            component = component.substring(1);
    540540        }
     
    545545        }
    546546
    547         WTFLogLevel logChannelLevel = WTFLogLevelError;
     547        WTFLogLevel logChannelLevel = WTFLogLevel::Error;
    548548        if (componentInfo.size() > 1) {
    549549            String level = componentInfo[1].stripWhiteSpace();
    550550            if (equalLettersIgnoringASCIICase(level, "error"))
    551                 logChannelLevel = WTFLogLevelError;
     551                logChannelLevel = WTFLogLevel::Error;
    552552            else if (equalLettersIgnoringASCIICase(level, "warning"))
    553                 logChannelLevel = WTFLogLevelWarning;
     553                logChannelLevel = WTFLogLevel::Warning;
    554554            else if (equalLettersIgnoringASCIICase(level, "info"))
    555                 logChannelLevel = WTFLogLevelInfo;
     555                logChannelLevel = WTFLogLevel::Info;
    556556            else if (equalLettersIgnoringASCIICase(level, "debug"))
    557                 logChannelLevel = WTFLogLevelDebug;
     557                logChannelLevel = WTFLogLevel::Debug;
    558558            else
    559559                WTFLogAlways("Unknown logging level: %s", level.utf8().data());
  • trunk/Source/WTF/wtf/Assertions.h

    r243135 r243141  
    149149#endif
    150150
    151 typedef enum { WTFLogChannelOff, WTFLogChannelOn, WTFLogChannelOnWithAccumulation } WTFLogChannelState;
    152 typedef enum { WTFLogLevelAlways, WTFLogLevelError, WTFLogLevelWarning, WTFLogLevelInfo, WTFLogLevelDebug } WTFLogLevel;
     151#ifdef __cplusplus
     152enum class WTFLogChannelState : uint8_t { Off, On, OnWithAccumulation };
     153#undef Always
     154enum class WTFLogLevel : uint8_t { Always, Error, Warning, Info, Debug };
     155#else
     156typedef uint8_t WTFLogChannelState;
     157typedef uint8_t WTFLogLevel;
     158#endif
    153159
    154160typedef struct {
     
    175181#if RELEASE_LOG_DISABLED
    176182#define DEFINE_LOG_CHANNEL(name, subsystem) \
    177     WTFLogChannel LOG_CHANNEL(name) = { WTFLogChannelOff, #name, WTFLogLevelError };
     183    WTFLogChannel LOG_CHANNEL(name) = { (WTFLogChannelState)0, #name, (WTFLogLevel)1 };
    178184#else
    179185#define DEFINE_LOG_CHANNEL(name, subsystem) \
    180     WTFLogChannel LOG_CHANNEL(name) = { WTFLogChannelOff, #name, WTFLogLevelError, subsystem, OS_LOG_DEFAULT };
     186    WTFLogChannel LOG_CHANNEL(name) = { (WTFLogChannelState)0, #name, (WTFLogLevel)1, subsystem, OS_LOG_DEFAULT };
    181187#endif
    182188#endif
  • trunk/Source/WTF/wtf/Logger.h

    r243135 r243141  
    127127        UNUSED_PARAM(channel);
    128128#else
    129         if (!willLog(channel, WTFLogLevelAlways))
    130             return;
    131 
    132         log(channel, WTFLogLevelAlways, arguments...);
     129        if (!willLog(channel, WTFLogLevel::Always))
     130            return;
     131
     132        log(channel, WTFLogLevel::Always, arguments...);
    133133#endif
    134134    }
     
    137137    inline void error(WTFLogChannel& channel, const Arguments&... arguments) const
    138138    {
    139         if (!willLog(channel, WTFLogLevelError))
    140             return;
    141 
    142         log(channel, WTFLogLevelError, arguments...);
     139        if (!willLog(channel, WTFLogLevel::Error))
     140            return;
     141
     142        log(channel, WTFLogLevel::Error, arguments...);
    143143    }
    144144
     
    146146    inline void warning(WTFLogChannel& channel, const Arguments&... arguments) const
    147147    {
    148         if (!willLog(channel, WTFLogLevelWarning))
    149             return;
    150 
    151         log(channel, WTFLogLevelWarning, arguments...);
     148        if (!willLog(channel, WTFLogLevel::Warning))
     149            return;
     150
     151        log(channel, WTFLogLevel::Warning, arguments...);
    152152    }
    153153
     
    155155    inline void info(WTFLogChannel& channel, const Arguments&... arguments) const
    156156    {
    157         if (!willLog(channel, WTFLogLevelInfo))
    158             return;
    159 
    160         log(channel, WTFLogLevelInfo, arguments...);
     157        if (!willLog(channel, WTFLogLevel::Info))
     158            return;
     159
     160        log(channel, WTFLogLevel::Info, arguments...);
    161161    }
    162162
     
    164164    inline void debug(WTFLogChannel& channel, const Arguments&... arguments) const
    165165    {
    166         if (!willLog(channel, WTFLogLevelDebug))
    167             return;
    168 
    169         log(channel, WTFLogLevelDebug, arguments...);
     166        if (!willLog(channel, WTFLogLevel::Debug))
     167            return;
     168
     169        log(channel, WTFLogLevel::Debug, arguments...);
    170170    }
    171171
     
    175175            return false;
    176176
    177         if (level <= WTFLogLevelError)
     177        if (level <= WTFLogLevel::Error)
    178178            return true;
    179179
    180         if (channel.state == WTFLogChannelOff || level > channel.level)
     180        if (channel.state == WTFLogChannelState::Off || level > channel.level)
    181181            return false;
    182182
     
    243243#endif
    244244
    245         if (channel.state == WTFLogChannelOff || level > channel.level)
     245        if (channel.state == WTFLogChannelState::Off || level > channel.level)
    246246            return;
    247247
  • trunk/Source/WTF/wtf/MemoryPressureHandler.cpp

    r243135 r243141  
    3636
    3737#if RELEASE_LOG_DISABLED
    38 WTFLogChannel LogMemoryPressure = { WTFLogChannelOn, "MemoryPressure", WTFLogLevelError };
     38WTFLogChannel LogMemoryPressure = { WTFLogChannelState::On, "MemoryPressure", WTFLogLevel::Error };
    3939#else
    40 WTFLogChannel LogMemoryPressure = { WTFLogChannelOn, "MemoryPressure", WTFLogLevelError, LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
     40WTFLogChannel LogMemoryPressure = { WTFLogChannelState::On, "MemoryPressure", WTFLogLevel::Error, LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
    4141#endif
    4242
  • trunk/Source/WTF/wtf/RefCountedLeakCounter.cpp

    r243135 r243141  
    4141#define LOG_CHANNEL_PREFIX Log
    4242#if RELEASE_LOG_DISABLED
    43 static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn, "RefCountedLeaks", WTFLogLevelError };
     43static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelState::On, "RefCountedLeaks", WTFLogLevel::Error };
    4444#else
    45 static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn, "RefCountedLeaks", WTFLogLevelError, LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
     45static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelState::On, "RefCountedLeaks", WTFLogLevel::Error, LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
    4646#endif
    4747
  • trunk/Source/WebCore/ChangeLog

    r243140 r243141  
     12019-03-19  Alex Christensen  <achristensen@webkit.org>
     2
     3        Make WTFLogChannelState and WTFLogLevel enum classes
     4        https://bugs.webkit.org/show_bug.cgi?id=195904
     5
     6        Reviewed by Eric Carlson.
     7
     8        * Modules/mediasource/SourceBuffer.cpp:
     9        (WebCore::removeSamplesFromTrackBuffer):
     10        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
     11        (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
     12        (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
     13        * dom/Document.cpp:
     14        (WebCore::messageLevelFromWTFLogLevel):
     15        * html/FTPDirectoryDocument.cpp:
     16        (WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
     17        * html/HTMLMediaElement.cpp:
     18        (WebCore::HTMLMediaElement::seekTask):
     19        (WebCore::HTMLMediaElement::selectNextSourceChild):
     20        (WebCore::HTMLMediaElement::sourceWasAdded):
     21        (WebCore::HTMLMediaElement::sourceWasRemoved):
     22        * inspector/agents/WebConsoleAgent.cpp:
     23        (WebCore::WebConsoleAgent::getLoggingChannels):
     24        (WebCore::channelConfigurationForString):
     25        * platform/Logging.cpp:
     26        (WebCore::isLogChannelEnabled):
     27        (WebCore::setLogChannelToAccumulate):
     28        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     29        (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
     30        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
     31        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
     32        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
     33        (WebCore::initializePeerConnectionFactoryAndThreads):
     34        * rendering/RenderLayerCompositor.cpp:
     35        (WebCore::compositingLogEnabled):
     36
    1372019-03-19  Philippe Normand  <pnormand@igalia.com>
    238
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp

    r243138 r243141  
    742742    auto logIdentifier = WTF::Logger::LogSiteIdentifier(buffer->logClassName(), logPrefix, buffer->logIdentifier());
    743743    auto& logger = buffer->logger();
    744     auto willLog = logger.willLog(buffer->logChannel(), WTFLogLevelDebug);
     744    auto willLog = logger.willLog(buffer->logChannel(), WTFLogLevel::Debug);
    745745#else
    746746    UNUSED_PARAM(logPrefix);
  • trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp

    r243135 r243141  
    866866
    867867        for (auto iterator = report->begin(); iterator != report->end(); ++iterator) {
    868             if (logger().willLog(logChannel(), WTFLogLevelDebug)) {
     868            if (logger().willLog(logChannel(), WTFLogLevel::Debug)) {
    869869                // Stats are very verbose, let's only display them in inspector console in verbose mode.
    870870                logger().debug(LogWebRTC,
     
    905905Seconds LibWebRTCMediaEndpoint::statsLogInterval(int64_t reportTimestamp) const
    906906{
    907     if (logger().willLog(logChannel(), WTFLogLevelInfo))
     907    if (logger().willLog(logChannel(), WTFLogLevel::Info))
    908908        return 2_s;
    909909
  • trunk/Source/WebCore/dom/Document.cpp

    r243135 r243141  
    85398539{
    85408540    switch (level) {
    8541     case WTFLogLevelAlways:
     8541    case WTFLogLevel::Always:
    85428542        return MessageLevel::Log;
    8543     case WTFLogLevelError:
     8543    case WTFLogLevel::Error:
    85448544        return MessageLevel::Error;
    85458545        break;
    8546     case WTFLogLevelWarning:
     8546    case WTFLogLevel::Warning:
    85478547        return MessageLevel::Warning;
    85488548        break;
    8549     case WTFLogLevelInfo:
     8549    case WTFLogLevel::Info:
    85508550        return MessageLevel::Info;
    85518551        break;
    8552     case WTFLogLevelDebug:
     8552    case WTFLogLevel::Debug:
    85538553        return MessageLevel::Debug;
    85548554        break;
  • trunk/Source/WebCore/html/FTPDirectoryDocument.cpp

    r243135 r243141  
    426426{
    427427#if !LOG_DISABLED
    428     LogFTP.state = WTFLogChannelOn;
     428    LogFTP.state = WTFLogChannelState::On;
    429429#endif
    430430}
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r243135 r243141  
    30763076    // not generate a timechanged callback. This means m_seeking will never be cleared and we will never
    30773077    // fire a 'seeked' event.
    3078     if (willLog(WTFLogLevelDebug)) {
     3078    if (willLog(WTFLogLevel::Debug)) {
    30793079        MediaTime mediaTime = m_player->mediaTimeForTimeValue(time);
    30803080        if (time != mediaTime)
     
    46524652
    46534653    // Don't log if this was just called to find out if there are any valid <source> elements.
    4654     bool shouldLog = willLog(WTFLogLevelDebug) && actionIfInvalid != DoNothing;
     4654    bool shouldLog = willLog(WTFLogLevel::Debug) && actionIfInvalid != DoNothing;
    46554655    if (shouldLog)
    46564656        INFO_LOG(LOGIDENTIFIER);
     
    47514751void HTMLMediaElement::sourceWasAdded(HTMLSourceElement& source)
    47524752{
    4753     if (willLog(WTFLogLevelInfo) && source.hasTagName(sourceTag)) {
     4753    if (willLog(WTFLogLevel::Info) && source.hasTagName(sourceTag)) {
    47544754        URL url = source.getNonEmptyURLAttribute(srcAttr);
    47554755        INFO_LOG(LOGIDENTIFIER, "'src' is ", url);
     
    48034803void HTMLMediaElement::sourceWasRemoved(HTMLSourceElement& source)
    48044804{
    4805     if (willLog(WTFLogLevelInfo) && source.hasTagName(sourceTag)) {
     4805    if (willLog(WTFLogLevel::Info) && source.hasTagName(sourceTag)) {
    48064806        URL url = source.getNonEmptyURLAttribute(srcAttr);
    48074807        INFO_LOG(LOGIDENTIFIER, "'src' is ", url);
  • trunk/Source/WebCore/inspector/agents/WebConsoleAgent.cpp

    r243135 r243141  
    6969
    7070        auto level = Inspector::Protocol::Console::ChannelLevel::Off;
    71         if (logChannel->state != WTFLogChannelOff) {
     71        if (logChannel->state != WTFLogChannelState::Off) {
    7272            switch (logChannel->level) {
    73             case WTFLogLevelAlways:
    74             case WTFLogLevelError:
    75             case WTFLogLevelWarning:
    76             case WTFLogLevelInfo:
     73            case WTFLogLevel::Always:
     74            case WTFLogLevel::Error:
     75            case WTFLogLevel::Warning:
     76            case WTFLogLevel::Info:
    7777                level = Inspector::Protocol::Console::ChannelLevel::Basic;
    7878                break;
    79             case WTFLogLevelDebug:
     79            case WTFLogLevel::Debug:
    8080                level = Inspector::Protocol::Console::ChannelLevel::Verbose;
    8181                break;
     
    9797
    9898    if (equalIgnoringASCIICase(levelString, "off")) {
    99         state = WTFLogChannelOff;
    100         level = WTFLogLevelError;
     99        state = WTFLogChannelState::Off;
     100        level = WTFLogLevel::Error;
    101101    } else {
    102         state = WTFLogChannelOn;
     102        state = WTFLogChannelState::On;
    103103        if (equalIgnoringASCIICase(levelString, "basic"))
    104             level = WTFLogLevelWarning;
     104            level = WTFLogLevel::Warning;
    105105        else if (equalIgnoringASCIICase(levelString, "verbose"))
    106             level = WTFLogLevelDebug;
     106            level = WTFLogLevel::Debug;
    107107        else
    108108            return WTF::nullopt;
  • trunk/Source/WebCore/platform/Logging.cpp

    r243135 r243141  
    5555    if (!channel)
    5656        return false;
    57     return channel->state != WTFLogChannelOff;
     57    return channel->state != WTFLogChannelState::Off;
    5858}
    5959
     
    6666        return;
    6767
    68     channel->state = WTFLogChannelOnWithAccumulation;
     68    channel->state = WTFLogChannelState::OnWithAccumulation;
    6969    logChannelsNeedInitialization = true;
    7070}
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r243135 r243141  
    35523552
    35533553#if !RELEASE_LOG_DISABLED
    3554         if (player->logger().willLog(player->logChannel(), WTFLogLevelDebug) && !([keyPath isEqualToString:@"loadedTimeRanges"] || [keyPath isEqualToString:@"seekableTimeRanges"])) {
     3554        if (player->logger().willLog(player->logChannel(), WTFLogLevel::Debug) && !([keyPath isEqualToString:@"loadedTimeRanges"] || [keyPath isEqualToString:@"seekableTimeRanges"])) {
    35553555            auto identifier = Logger::LogSiteIdentifier("MediaPlayerPrivateAVFoundation", "observeValueForKeyPath", player->logIdentifier());
    35563556
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm

    r243135 r243141  
    386386    DEBUG_LOG(LOGIDENTIFIER, "updated sample = ", sample);
    387387
    388     if (WILL_LOG(WTFLogLevelDebug)) {
     388    if (WILL_LOG(WTFLogLevel::Debug)) {
    389389        MediaTime now = streamTime();
    390390        double delta = (sample.presentationTime() - now).toDouble();
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp

    r243135 r243141  
    3535{
    3636#if !LOG_DISABLED
    37     return LogCompositing.state == WTFLogChannelOn;
     37    return LogCompositing.state == WTFLogChannelState::On;
    3838#else
    3939    return false;
  • trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp

    r243135 r243141  
    143143#if defined(NDEBUG)
    144144#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    145     if (LogWebRTC.state != WTFLogChannelOn)
     145    if (LogWebRTC.state != WTFLogChannelState::On)
    146146        return rtc::LS_ERROR;
    147147
    148148    switch (LogWebRTC.level) {
    149     case WTFLogLevelAlways:
    150     case WTFLogLevelError:
     149    case WTFLogLevel::Always:
     150    case WTFLogLevel::Error:
    151151        return rtc::LS_ERROR;
    152     case WTFLogLevelWarning:
     152    case WTFLogLevel::Warning:
    153153        return rtc::LS_WARNING;
    154     case WTFLogLevelInfo:
     154    case WTFLogLevel::Info:
    155155        return rtc::LS_INFO;
    156     case WTFLogLevelDebug:
     156    case WTFLogLevel::Debug:
    157157        return rtc::LS_VERBOSE;
    158158    }
     
    161161#endif
    162162#else
    163     return (LogWebRTC.state != WTFLogChannelOn) ? rtc::LS_WARNING : rtc::LS_INFO;
     163    return (LogWebRTC.state != WTFLogChannelState::On) ? rtc::LS_WARNING : rtc::LS_INFO;
    164164#endif
    165165}
  • trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm

    r243135 r243141  
    746746
    747747#if !RELEASE_LOG_DISABLED
    748     if (m_callback->loggerPtr() && m_callback->logger().willLog(m_callback->logChannel(), WTFLogLevelDebug)) {
     748    if (m_callback->loggerPtr() && m_callback->logger().willLog(m_callback->logChannel(), WTFLogLevel::Debug)) {
    749749        auto identifier = Logger::LogSiteIdentifier("AVVideoCaptureSource", "observeValueForKeyPath", m_callback->logIdentifier());
    750750
  • trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp

    r243135 r243141  
    157157{
    158158#if !LOG_DISABLED
    159     if (LogNetwork.state != WTFLogChannelOn || soup_session_get_feature(m_soupSession.get(), SOUP_TYPE_LOGGER))
     159    if (LogNetwork.state != WTFLogChannelState::On || soup_session_get_feature(m_soupSession.get(), SOUP_TYPE_LOGGER))
    160160        return;
    161161
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r243135 r243141  
    274274static inline bool compositingLogEnabled()
    275275{
    276     return LogCompositing.state == WTFLogChannelOn;
     276    return LogCompositing.state == WTFLogChannelState::On;
    277277}
    278278#endif
  • trunk/Source/WebKit/ChangeLog

    r243135 r243141  
     12019-03-19  Alex Christensen  <achristensen@webkit.org>
     2
     3        Make WTFLogChannelState and WTFLogLevel enum classes
     4        https://bugs.webkit.org/show_bug.cgi?id=195904
     5
     6        Reviewed by Eric Carlson.
     7
     8        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
     9        (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
     10        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
     11        (WebKit::NetworkRTCProvider::NetworkRTCProvider):
     12
    1132019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
    214
  • trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp

    r243135 r243141  
    6868{
    6969#if !LOG_DISABLED
    70     if (WebKit2LogNetworkCacheSpeculativePreloading.state == WTFLogChannelOn)
     70    if (WebKit2LogNetworkCacheSpeculativePreloading.state == WTFLogChannelState::On)
    7171        allSpeculativeLoadingDiagnosticMessages().add(message);
    7272#endif
  • trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp

    r243135 r243141  
    6666    rtc::LogMessage::LogToDebug(rtc::LS_NONE);
    6767#else
    68     if (WebKit2LogWebRTC.state != WTFLogChannelOn)
     68    if (WebKit2LogWebRTC.state != WTFLogChannelState::On)
    6969        rtc::LogMessage::LogToDebug(rtc::LS_WARNING);
    7070#endif
  • trunk/Tools/ChangeLog

    r243139 r243141  
     12019-03-19  Alex Christensen  <achristensen@webkit.org>
     2
     3        Make WTFLogChannelState and WTFLogLevel enum classes
     4        https://bugs.webkit.org/show_bug.cgi?id=195904
     5
     6        Reviewed by Eric Carlson.
     7
     8        * TestWebKitAPI/Tests/WebCore/Logging.cpp:
     9        (TestWebKitAPI::TEST_F):
     10
    1112019-03-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/Logging.cpp

    r243135 r243141  
    7373
    7474        WTFInitializeLogChannelStatesFromString(testLogChannels, logChannelCount, "all");
    75         WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelError);
    76         WTFSetLogChannelLevel(&TestChannel2, WTFLogLevelError);
    77         WTFSetLogChannelLevel(&TestChannel3, WTFLogLevelError);
    78         WTFSetLogChannelLevel(&TestChannel4, WTFLogLevelError);
     75        WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Error);
     76        WTFSetLogChannelLevel(&TestChannel2, WTFLogLevel::Error);
     77        WTFSetLogChannelLevel(&TestChannel3, WTFLogLevel::Error);
     78        WTFSetLogChannelLevel(&TestChannel4, WTFLogLevel::Error);
    7979    }
    8080
     
    111111TEST_F(LoggingTest, Initialization)
    112112{
    113     EXPECT_EQ(TestChannel1.state, WTFLogChannelOn);
    114     EXPECT_EQ(TestChannel2.state, WTFLogChannelOn);
    115     EXPECT_EQ(TestChannel3.state, WTFLogChannelOn);
    116     EXPECT_EQ(TestChannel4.state, WTFLogChannelOn);
    117 
    118     EXPECT_EQ(TestChannel1.level, WTFLogLevelError);
    119     EXPECT_EQ(TestChannel2.level, WTFLogLevelError);
    120     EXPECT_EQ(TestChannel3.level, WTFLogLevelError);
    121     EXPECT_EQ(TestChannel4.level, WTFLogLevelError);
    122 
    123     TestChannel1.state = WTFLogChannelOff;
     113    EXPECT_EQ(TestChannel1.state, WTFLogChannelState::On);
     114    EXPECT_EQ(TestChannel2.state, WTFLogChannelState::On);
     115    EXPECT_EQ(TestChannel3.state, WTFLogChannelState::On);
     116    EXPECT_EQ(TestChannel4.state, WTFLogChannelState::On);
     117
     118    EXPECT_EQ(TestChannel1.level, WTFLogLevel::Error);
     119    EXPECT_EQ(TestChannel2.level, WTFLogLevel::Error);
     120    EXPECT_EQ(TestChannel3.level, WTFLogLevel::Error);
     121    EXPECT_EQ(TestChannel4.level, WTFLogLevel::Error);
     122
     123    TestChannel1.state = WTFLogChannelState::Off;
    124124    WTFInitializeLogChannelStatesFromString(testLogChannels, logChannelCount, "Channel1");
    125     EXPECT_EQ(TestChannel1.level, WTFLogLevelError);
    126     EXPECT_EQ(TestChannel1.state, WTFLogChannelOn);
    127 
    128     TestChannel1.state = WTFLogChannelOff;
     125    EXPECT_EQ(TestChannel1.level, WTFLogLevel::Error);
     126    EXPECT_EQ(TestChannel1.state, WTFLogChannelState::On);
     127
     128    TestChannel1.state = WTFLogChannelState::Off;
    129129    WTFInitializeLogChannelStatesFromString(testLogChannels, logChannelCount, "Channel1=foo");
    130     EXPECT_EQ(TestChannel1.level, WTFLogLevelError);
     130    EXPECT_EQ(TestChannel1.level, WTFLogLevel::Error);
    131131#if TEST_OUTPUT
    132132    EXPECT_TRUE(output().contains("Unknown logging level: foo", false));
     
    134134
    135135    WTFInitializeLogChannelStatesFromString(testLogChannels, logChannelCount, "Channel1=warning");
    136     EXPECT_EQ(TestChannel1.level, WTFLogLevelWarning);
    137     EXPECT_EQ(TestChannel2.level, WTFLogLevelError);
    138     EXPECT_EQ(TestChannel3.level, WTFLogLevelError);
    139     EXPECT_EQ(TestChannel4.level, WTFLogLevelError);
     136    EXPECT_EQ(TestChannel1.level, WTFLogLevel::Warning);
     137    EXPECT_EQ(TestChannel2.level, WTFLogLevel::Error);
     138    EXPECT_EQ(TestChannel3.level, WTFLogLevel::Error);
     139    EXPECT_EQ(TestChannel4.level, WTFLogLevel::Error);
    140140
    141141    WTFInitializeLogChannelStatesFromString(testLogChannels, logChannelCount, "Channel4=   debug, Channel3 = info,Channel2=error");
    142     EXPECT_EQ(TestChannel1.level, WTFLogLevelWarning);
    143     EXPECT_EQ(TestChannel2.level, WTFLogLevelError);
    144     EXPECT_EQ(TestChannel3.level, WTFLogLevelInfo);
    145     EXPECT_EQ(TestChannel4.level, WTFLogLevelDebug);
     142    EXPECT_EQ(TestChannel1.level, WTFLogLevel::Warning);
     143    EXPECT_EQ(TestChannel2.level, WTFLogLevel::Error);
     144    EXPECT_EQ(TestChannel3.level, WTFLogLevel::Info);
     145    EXPECT_EQ(TestChannel4.level, WTFLogLevel::Debug);
    146146
    147147    WTFInitializeLogChannelStatesFromString(testLogChannels, logChannelCount, "-all");
    148     EXPECT_EQ(TestChannel1.state, WTFLogChannelOff);
    149     EXPECT_EQ(TestChannel2.state, WTFLogChannelOff);
    150     EXPECT_EQ(TestChannel3.state, WTFLogChannelOff);
    151     EXPECT_EQ(TestChannel4.state, WTFLogChannelOff);
     148    EXPECT_EQ(TestChannel1.state, WTFLogChannelState::Off);
     149    EXPECT_EQ(TestChannel2.state, WTFLogChannelState::Off);
     150    EXPECT_EQ(TestChannel3.state, WTFLogChannelState::Off);
     151    EXPECT_EQ(TestChannel4.state, WTFLogChannelState::Off);
    152152
    153153    WTFInitializeLogChannelStatesFromString(testLogChannels, logChannelCount, "all");
    154     EXPECT_EQ(TestChannel1.state, WTFLogChannelOn);
    155     EXPECT_EQ(TestChannel2.state, WTFLogChannelOn);
    156     EXPECT_EQ(TestChannel3.state, WTFLogChannelOn);
    157     EXPECT_EQ(TestChannel4.state, WTFLogChannelOn);
     154    EXPECT_EQ(TestChannel1.state, WTFLogChannelState::On);
     155    EXPECT_EQ(TestChannel2.state, WTFLogChannelState::On);
     156    EXPECT_EQ(TestChannel3.state, WTFLogChannelState::On);
     157    EXPECT_EQ(TestChannel4.state, WTFLogChannelState::On);
    158158}
    159159
    160160TEST_F(LoggingTest, WTFWillLogWithLevel)
    161161{
    162     EXPECT_EQ(TestChannel1.state, WTFLogChannelOn);
    163     EXPECT_EQ(TestChannel2.state, WTFLogChannelOn);
    164     EXPECT_EQ(TestChannel3.state, WTFLogChannelOn);
    165     EXPECT_EQ(TestChannel4.state, WTFLogChannelOn);
    166 
    167     EXPECT_EQ(TestChannel1.level, WTFLogLevelError);
    168     EXPECT_EQ(TestChannel2.level, WTFLogLevelError);
    169     EXPECT_EQ(TestChannel3.level, WTFLogLevelError);
    170     EXPECT_EQ(TestChannel4.level, WTFLogLevelError);
    171 
    172     EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelError));
    173     EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel2, WTFLogLevelError));
    174     EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel3, WTFLogLevelError));
    175     EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel4, WTFLogLevelError));
    176 
    177     EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelInfo));
    178     EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel2, WTFLogLevelInfo));
    179     EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel3, WTFLogLevelInfo));
    180     EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel4, WTFLogLevelInfo));
    181 
    182     TestChannel1.state = WTFLogChannelOff;
    183     EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelError));
    184     EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelInfo));
    185 
    186     TestChannel1.state = WTFLogChannelOn;
    187     EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelError));
    188     EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelInfo));
    189 
    190     TestChannel1.level = WTFLogLevelInfo;
    191     EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelError));
    192     EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevelInfo));
     162    EXPECT_EQ(TestChannel1.state, WTFLogChannelState::On);
     163    EXPECT_EQ(TestChannel2.state, WTFLogChannelState::On);
     164    EXPECT_EQ(TestChannel3.state, WTFLogChannelState::On);
     165    EXPECT_EQ(TestChannel4.state, WTFLogChannelState::On);
     166
     167    EXPECT_EQ(TestChannel1.level, WTFLogLevel::Error);
     168    EXPECT_EQ(TestChannel2.level, WTFLogLevel::Error);
     169    EXPECT_EQ(TestChannel3.level, WTFLogLevel::Error);
     170    EXPECT_EQ(TestChannel4.level, WTFLogLevel::Error);
     171
     172    EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Error));
     173    EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel2, WTFLogLevel::Error));
     174    EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel3, WTFLogLevel::Error));
     175    EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel4, WTFLogLevel::Error));
     176
     177    EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Info));
     178    EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel2, WTFLogLevel::Info));
     179    EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel3, WTFLogLevel::Info));
     180    EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel4, WTFLogLevel::Info));
     181
     182    TestChannel1.state = WTFLogChannelState::Off;
     183    EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Error));
     184    EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Info));
     185
     186    TestChannel1.state = WTFLogChannelState::On;
     187    EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Error));
     188    EXPECT_FALSE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Info));
     189
     190    TestChannel1.level = WTFLogLevel::Info;
     191    EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Error));
     192    EXPECT_TRUE(WTFWillLogWithLevel(&TestChannel1, WTFLogLevel::Info));
    193193}
    194194
     
    202202TEST_F(LoggingTest, LOG_WITH_LEVEL)
    203203{
    204     LOG_WITH_LEVEL(Channel1, WTFLogLevelError, "Go and boil your bottoms, you sons of a silly person.");
     204    LOG_WITH_LEVEL(Channel1, WTFLogLevel::Error, "Go and boil your bottoms, you sons of a silly person.");
    205205    EXPECT_TRUE(output().contains("sons of a silly person.", false));
    206206
    207     LOG_WITH_LEVEL(Channel1, WTFLogLevelWarning, "You don't frighten us, English pig dogs.");
    208     EXPECT_EQ(0u, output().length());
    209 
    210     WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelInfo);
    211     LOG_WITH_LEVEL(Channel1, WTFLogLevelWarning, "I'm French. Why do you think I have this outrageous accent, you silly king?");
     207    LOG_WITH_LEVEL(Channel1, WTFLogLevel::Warning, "You don't frighten us, English pig dogs.");
     208    EXPECT_EQ(0u, output().length());
     209
     210    WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Info);
     211    LOG_WITH_LEVEL(Channel1, WTFLogLevel::Warning, "I'm French. Why do you think I have this outrageous accent, you silly king?");
    212212    EXPECT_TRUE(output().contains("outrageous accent", false));
    213213
    214     LOG_WITH_LEVEL(Channel1, WTFLogLevelDebug, "You don't frighten us with your silly knees-bent running around advancing behavior!");
    215     EXPECT_EQ(0u, output().length());
    216 
    217     WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelDebug);
    218     LOG_WITH_LEVEL(Channel1, WTFLogLevelDebug, "Go and tell your master that we have been charged by God with a sacred quest.");
     214    LOG_WITH_LEVEL(Channel1, WTFLogLevel::Debug, "You don't frighten us with your silly knees-bent running around advancing behavior!");
     215    EXPECT_EQ(0u, output().length());
     216
     217    WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Debug);
     218    LOG_WITH_LEVEL(Channel1, WTFLogLevel::Debug, "Go and tell your master that we have been charged by God with a sacred quest.");
    219219    EXPECT_TRUE(output().contains("sacred quest", false));
    220220}
     
    239239TEST_F(LoggingTest, RELEASE_LOG_WITH_LEVEL)
    240240{
    241     RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevelError, "You don't frighten us, English pig dogs.");
     241    RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevel::Error, "You don't frighten us, English pig dogs.");
    242242    EXPECT_TRUE(output().contains("pig dogs.", false));
    243243
    244     RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevelWarning, "Go and boil your bottoms, you sons of a silly person.");
    245     EXPECT_EQ(0u, output().length());
    246 
    247     WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelInfo);
    248     RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevelWarning, "I'm French. Why do you think I have this outrageous accent, you silly king?");
     244    RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevel::Warning, "Go and boil your bottoms, you sons of a silly person.");
     245    EXPECT_EQ(0u, output().length());
     246
     247    WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Info);
     248    RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevel::Warning, "I'm French. Why do you think I have this outrageous accent, you silly king?");
    249249    EXPECT_TRUE(output().contains("outrageous accent", false));
    250250
    251     RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevelDebug, "You don't frighten us with your silly knees-bent running around advancing behavior!");
    252     EXPECT_EQ(0u, output().length());
    253 
    254     WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelDebug);
    255     RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevelDebug, "Go and tell your master that we have been charged by God with a sacred quest.");
     251    RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevel::Debug, "You don't frighten us with your silly knees-bent running around advancing behavior!");
     252    EXPECT_EQ(0u, output().length());
     253
     254    WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Debug);
     255    RELEASE_LOG_WITH_LEVEL(Channel1, WTFLogLevel::Debug, "Go and tell your master that we have been charged by God with a sacred quest.");
    256256    EXPECT_TRUE(output().contains("sacred quest", false));
    257257}
     
    260260{
    261261    bool enabled = true;
    262     RELEASE_LOG_WITH_LEVEL_IF(enabled, Channel1, WTFLogLevelError, "Is there someone else up there that we can talk to?");
     262    RELEASE_LOG_WITH_LEVEL_IF(enabled, Channel1, WTFLogLevel::Error, "Is there someone else up there that we can talk to?");
    263263    EXPECT_TRUE(output().contains("someone else", false));
    264264
    265     RELEASE_LOG_WITH_LEVEL_IF(enabled, Channel1, WTFLogLevelDebug, "No, now go away");
     265    RELEASE_LOG_WITH_LEVEL_IF(enabled, Channel1, WTFLogLevel::Debug, "No, now go away");
    266266    EXPECT_EQ(0u, output().length());
    267267
    268268    enabled = false;
    269     RELEASE_LOG_WITH_LEVEL_IF(enabled, Channel1, WTFLogLevelWarning, "or I shall taunt you a second time! %i", 12);
     269    RELEASE_LOG_WITH_LEVEL_IF(enabled, Channel1, WTFLogLevel::Warning, "or I shall taunt you a second time! %i", 12);
    270270    EXPECT_EQ(0u, output().length());
    271271}
     
    276276    EXPECT_TRUE(logger->enabled());
    277277
    278     WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelError);
    279     EXPECT_TRUE(logger->willLog(TestChannel1, WTFLogLevelError));
     278    WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Error);
     279    EXPECT_TRUE(logger->willLog(TestChannel1, WTFLogLevel::Error));
    280280    logger->error(TestChannel1, "You're using coconuts!");
    281281    EXPECT_TRUE(output().contains("You're using coconuts!", false));
     
    306306    EXPECT_TRUE(output().contains("You've got 2 empty halves of coconuts!", false));
    307307
    308     WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelError);
     308    WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Error);
    309309    logger->logAlways(TestChannel1, "I shall taunt you a second time!");
    310310    EXPECT_TRUE(output().contains("I shall taunt you a second time!", false));
    311311
    312312    logger->setEnabled(this, false);
    313     EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevelError));
    314     EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevelWarning));
    315     EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevelInfo));
    316     EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevelDebug));
     313    EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevel::Error));
     314    EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevel::Warning));
     315    EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevel::Info));
     316    EXPECT_FALSE(logger->willLog(TestChannel1, WTFLogLevel::Debug));
    317317    EXPECT_FALSE(logger->enabled());
    318318    logger->logAlways(TestChannel1, "You've got two empty halves of coconuts");
     
    349349    EXPECT_TRUE(result.contains("to the show that never", false));
    350350
    351     WTFSetLogChannelLevel(&TestChannel1, WTFLogLevelWarning);
     351    WTFSetLogChannelLevel(&TestChannel1, WTFLogLevel::Warning);
    352352
    353353    ERROR_LOG(LOGIDENTIFIER, "We're so glad you could attend");
     
    389389    StringBuilder m_logBuffer;
    390390    WTFLogChannel m_lastChannel;
    391     WTFLogLevel m_lastLevel { WTFLogLevelError };
     391    WTFLogLevel m_lastLevel { WTFLogLevel::Error };
    392392};
    393393
     
    404404    EXPECT_TRUE(observer.log().contains("testing 1, 2, 3", false));
    405405    EXPECT_STREQ(observer.channel().name, logChannel().name);
    406     EXPECT_EQ(static_cast<int>(WTFLogLevelAlways), static_cast<int>(observer.level()));
     406    EXPECT_EQ(static_cast<int>(WTFLogLevel::Always), static_cast<int>(observer.level()));
    407407
    408408    logger().removeObserver(observer);
Note: See TracChangeset for help on using the changeset viewer.