Changeset 259707 in webkit


Ignore:
Timestamp:
Apr 8, 2020 1:40:19 AM (4 years ago)
Author:
Philippe Normand
Message:

[GTK][WPE] Release logs are unconditionally filling the journal
https://bugs.webkit.org/show_bug.cgi?id=209421

Reviewed by Carlos Alberto Lopez Perez.

.:

Re-enable Systemd logging and make it opt-in via the WEBKIT_DEBUG environment variable.

  • Source/cmake/OptionsGTK.cmake:
  • Source/cmake/OptionsWPE.cmake:

Source/WebCore:

  • platform/unix/LoggingUnix.cpp:

(WebCore::logLevelString): Disable all logging when the
WEBKIT_DEBUG environment variable is empty.

Source/WTF:

  • wtf/Assertions.h: Don't send logs to systemd for disabled log channels.
  • wtf/Logger.h:

(WTF::Logger::willLog const): Ditto.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r259641 r259707  
     12020-04-08  Philippe Normand  <pnormand@igalia.com>
     2
     3        [GTK][WPE] Release logs are unconditionally filling the journal
     4        https://bugs.webkit.org/show_bug.cgi?id=209421
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        Re-enable Systemd logging and make it opt-in via the WEBKIT_DEBUG environment variable.
     9
     10        * Source/cmake/OptionsGTK.cmake:
     11        * Source/cmake/OptionsWPE.cmake:
     12
    1132020-04-07  Adrian Perez de Castro  <aperez@igalia.com>
    214
  • trunk/Source/WTF/ChangeLog

    r259674 r259707  
     12020-04-08  Philippe Normand  <pnormand@igalia.com>
     2
     3        [GTK][WPE] Release logs are unconditionally filling the journal
     4        https://bugs.webkit.org/show_bug.cgi?id=209421
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        * wtf/Assertions.h: Don't send logs to systemd for disabled log channels.
     9        * wtf/Logger.h:
     10        (WTF::Logger::willLog const): Ditto.
     11
    1122020-04-07  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/Source/WTF/wtf/Assertions.h

    r258547 r259707  
    542542#if USE(JOURNALD) && !RELEASE_LOG_DISABLED
    543543#define PUBLIC_LOG_STRING "s"
    544 #define SD_JOURNAL_SEND(channel, priority, file, line, function, ...) sd_journal_send_with_location("CODE_FILE=" file, "CODE_LINE=" line, function, "WEBKIT_SUBSYSTEM=%s", LOG_CHANNEL(channel).subsystem, "WEBKIT_CHANNEL=%s", LOG_CHANNEL(channel).name, "PRIORITY=%i", priority, "MESSAGE=" __VA_ARGS__, nullptr)
     544#define SD_JOURNAL_SEND(channel, priority, file, line, function, ...) do { \
     545    if (LOG_CHANNEL(channel).state != WTFLogChannelState::Off) \
     546        sd_journal_send_with_location("CODE_FILE=" file, "CODE_LINE=" line, function, "WEBKIT_SUBSYSTEM=%s", LOG_CHANNEL(channel).subsystem, "WEBKIT_CHANNEL=%s", LOG_CHANNEL(channel).name, "PRIORITY=%i", priority, "MESSAGE=" __VA_ARGS__, nullptr); \
     547} while (0)
    545548
    546549#define _XSTRINGIFY(line) #line
  • trunk/Source/WTF/wtf/Logger.h

    r258691 r259707  
    239239            return false;
    240240
     241#if USE(SYSTEMD)
     242        if (channel.state == WTFLogChannelState::Off)
     243            return false;
     244#endif
     245
    241246        if (level <= WTFLogLevel::Error)
    242247            return true;
  • trunk/Source/WebCore/ChangeLog

    r259706 r259707  
     12020-04-08  Philippe Normand  <pnormand@igalia.com>
     2
     3        [GTK][WPE] Release logs are unconditionally filling the journal
     4        https://bugs.webkit.org/show_bug.cgi?id=209421
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        * platform/unix/LoggingUnix.cpp:
     9        (WebCore::logLevelString): Disable all logging when the
     10        WEBKIT_DEBUG environment variable is empty.
     11
    1122020-04-07  Antoine Quint  <graouts@apple.com>
    213
  • trunk/Source/WebCore/platform/unix/LoggingUnix.cpp

    r258754 r259707  
    3333{
    3434    char* logEnv = getenv("WEBKIT_DEBUG");
     35
     36    // Disable all log channels if WEBKIT_DEBUG is unset.
    3537    if (!logEnv)
    36         return emptyString();
     38        return makeString("-all"_s);
    3739
    3840    // We set up the logs anyway because some of our logging, such as Soup's is available in release builds.
  • trunk/Source/cmake/OptionsGTK.cmake

    r259641 r259707  
    9292WEBKIT_OPTION_DEFINE(USE_WOFF2 "Whether to enable support for WOFF2 Web Fonts." PUBLIC ON)
    9393WEBKIT_OPTION_DEFINE(USE_WPE_RENDERER "Whether to enable WPE rendering" PUBLIC ON)
    94 WEBKIT_OPTION_DEFINE(USE_SYSTEMD "Whether to enable journald logging" PUBLIC OFF)
     94WEBKIT_OPTION_DEFINE(USE_SYSTEMD "Whether to enable journald logging" PUBLIC ON)
    9595
    9696# Private options specific to the GTK port. Changing these options is
  • trunk/Source/cmake/OptionsWPE.cmake

    r259606 r259707  
    8080WEBKIT_OPTION_DEFINE(USE_WOFF2 "Whether to enable support for WOFF2 Web Fonts." PUBLIC ON)
    8181WEBKIT_OPTION_DEFINE(ENABLE_WPE_QT_API "Whether to enable support for the Qt5/QML plugin" PUBLIC OFF)
    82 WEBKIT_OPTION_DEFINE(USE_SYSTEMD "Whether to enable journald logging" PUBLIC OFF)
     82WEBKIT_OPTION_DEFINE(USE_SYSTEMD "Whether to enable journald logging" PUBLIC ON)
    8383
    8484# Private options specific to the WPE port.
Note: See TracChangeset for help on using the changeset viewer.