Diff
Modified: trunk/ChangeLog (284672 => 284673)
--- trunk/ChangeLog 2021-10-22 08:19:07 UTC (rev 284672)
+++ trunk/ChangeLog 2021-10-22 08:44:02 UTC (rev 284673)
@@ -1,3 +1,16 @@
+2021-10-22 Pablo Correa Gómez <[email protected]>
+
+ Enable logging under non-systemd linux distros
+ https://bugs.webkit.org/show_bug.cgi?id=232080
+
+ Reviewed by Michael Catanzaro.
+
+ * Source/cmake/FindJournald.cmake: Renamed from Source/cmake/FindSystemd.cmake.
+ * Source/cmake/OptionsGTK.cmake: Replace USE_SYSTEMD for
+ ENABLE_JOURNALD_LOG
+ * Source/cmake/OptionsWPE.cmake: Replace USE_SYSTEMD for
+ ENABLE_JOURNALD_LOG
+
2021-10-21 Eric Carlson <[email protected]>
Add GitHub name to contributors.json
Modified: trunk/Source/WTF/ChangeLog (284672 => 284673)
--- trunk/Source/WTF/ChangeLog 2021-10-22 08:19:07 UTC (rev 284672)
+++ trunk/Source/WTF/ChangeLog 2021-10-22 08:44:02 UTC (rev 284673)
@@ -1,3 +1,17 @@
+2021-10-22 Pablo Correa Gómez <[email protected]>
+
+ Enable logging in under non-systemd linux distros
+ https://bugs.webkit.org/show_bug.cgi?id=232080
+
+ Reviewed by Michael Catanzaro.
+
+ * wtf/Assertions.h: Rename USE(JOURNALD) to ENABLE(JOURNALD_LOG)
+ * wtf/Logger.h:
+ (WTF::Logger::willLog const): Rename USE(JOURNALD) to
+ ENABLE(JOURNALD_LOG)
+ * wtf/PlatformGTK.cmake: Use renamed Journald library
+ * wtf/PlatformWPE.cmake: Use renamed Journald library
+
2021-10-21 Aditya Keerthi <[email protected]>
[Cocoa] Enable accent-color by default
Modified: trunk/Source/WTF/wtf/Assertions.cpp (284672 => 284673)
--- trunk/Source/WTF/wtf/Assertions.cpp 2021-10-22 08:19:07 UTC (rev 284672)
+++ trunk/Source/WTF/wtf/Assertions.cpp 2021-10-22 08:44:02 UTC (rev 284673)
@@ -609,7 +609,7 @@
out.printf("%-3d %p %s", frameNumber, stackFrame, demangled->mangledName());
else
out.printf("%-3d %p", frameNumber, stackFrame);
-#if USE(JOURNALD)
+#if ENABLE(JOURNALD_LOG)
sd_journal_send("WEBKIT_SUBSYSTEM=%s", channel->subsystem, "WEBKIT_CHANNEL=%s", channel->name, "MESSAGE=%s", out.toCString().data(), nullptr);
#else
fprintf(stderr, "[%s:%s:-] %s\n", channel->subsystem, channel->name, out.toCString().data());
Modified: trunk/Source/WTF/wtf/Assertions.h (284672 => 284673)
--- trunk/Source/WTF/wtf/Assertions.h 2021-10-22 08:19:07 UTC (rev 284672)
+++ trunk/Source/WTF/wtf/Assertions.h 2021-10-22 08:44:02 UTC (rev 284673)
@@ -51,7 +51,7 @@
#include <os/log.h>
#endif
-#if USE(JOURNALD)
+#if ENABLE(JOURNALD_LOG)
#define SD_JOURNAL_SUPPRESS_LOCATION
#include <systemd/sd-journal.h>
#endif
@@ -98,11 +98,11 @@
#if ENABLE(RELEASE_LOG)
#define RELEASE_LOG_DISABLED 0
#else
-#define RELEASE_LOG_DISABLED !(USE(OS_LOG) || USE(JOURNALD))
+#define RELEASE_LOG_DISABLED !(USE(OS_LOG) || ENABLE(JOURNALD_LOG))
#endif
#ifndef VERBOSE_RELEASE_LOG
-#define VERBOSE_RELEASE_LOG USE(JOURNALD)
+#define VERBOSE_RELEASE_LOG ENABLE(JOURNALD_LOG)
#endif
#if COMPILER(GCC_COMPATIBLE)
@@ -565,7 +565,7 @@
os_log(LOG_CHANNEL(channel).osLogChannel, __VA_ARGS__); \
} while (0)
-#elif USE(JOURNALD)
+#elif ENABLE(JOURNALD_LOG)
#define PUBLIC_LOG_STRING "s"
#define PRIVATE_LOG_STRING "s"
Modified: trunk/Source/WTF/wtf/Logger.h (284672 => 284673)
--- trunk/Source/WTF/wtf/Logger.h 2021-10-22 08:19:07 UTC (rev 284672)
+++ trunk/Source/WTF/wtf/Logger.h 2021-10-22 08:44:02 UTC (rev 284673)
@@ -30,7 +30,7 @@
#include <wtf/ThreadSafeRefCounted.h>
#include <wtf/text/StringBuilder.h>
-#if USE(JOURNALD)
+#if ENABLE(JOURNALD_LOG)
#define SD_JOURNAL_SUPPRESS_LOCATION
#include <systemd/sd-journal.h>
#endif
@@ -241,7 +241,7 @@
if (!m_enabled)
return false;
-#if USE(SYSTEMD)
+#if ENABLE(JOURNALD_LOG)
if (channel.state == WTFLogChannelState::Off)
return false;
#endif
@@ -314,7 +314,7 @@
WTFLog(&channel, "%s", logMessage.utf8().data());
#elif USE(OS_LOG)
os_log(channel.osLogChannel, "%{public}s", logMessage.utf8().data());
-#elif USE(JOURNALD)
+#elif ENABLE(JOURNALD_LOG)
sd_journal_send("WEBKIT_SUBSYSTEM=%s", channel.subsystem, "WEBKIT_CHANNEL=%s", channel.name, "MESSAGE=%s", logMessage.utf8().data(), nullptr);
#else
fprintf(stderr, "[%s:%s:-] %s\n", channel.subsystem, channel.name, logMessage.utf8().data());
@@ -343,7 +343,7 @@
UNUSED_PARAM(file);
UNUSED_PARAM(line);
UNUSED_PARAM(function);
-#elif USE(JOURNALD)
+#elif ENABLE(JOURNALD_LOG)
auto fileString = makeString("CODE_FILE=", file);
auto lineString = makeString("CODE_LINE=", line);
sd_journal_send_with_location(fileString.utf8().data(), lineString.utf8().data(), function, "WEBKIT_SUBSYSTEM=%s", channel.subsystem, "WEBKIT_CHANNEL=%s", channel.name, "MESSAGE=%s", logMessage.utf8().data(), nullptr);
Modified: trunk/Source/WTF/wtf/PlatformGTK.cmake (284672 => 284673)
--- trunk/Source/WTF/wtf/PlatformGTK.cmake 2021-10-22 08:19:07 UTC (rev 284672)
+++ trunk/Source/WTF/wtf/PlatformGTK.cmake 2021-10-22 08:44:02 UTC (rev 284673)
@@ -79,8 +79,8 @@
ZLIB::ZLIB
)
-if (Systemd_FOUND)
- list(APPEND WTF_LIBRARIES Systemd::Systemd)
+if (Journald_FOUND)
+ list(APPEND WTF_LIBRARIES Journald::Journald)
endif ()
list(APPEND WTF_SYSTEM_INCLUDE_DIRECTORIES
Modified: trunk/Source/WTF/wtf/PlatformWPE.cmake (284672 => 284673)
--- trunk/Source/WTF/wtf/PlatformWPE.cmake 2021-10-22 08:19:07 UTC (rev 284672)
+++ trunk/Source/WTF/wtf/PlatformWPE.cmake 2021-10-22 08:44:02 UTC (rev 284673)
@@ -52,8 +52,8 @@
ZLIB::ZLIB
)
-if (Systemd_FOUND)
- list(APPEND WTF_LIBRARIES Systemd::Systemd)
+if (Journald_FOUND)
+ list(APPEND WTF_LIBRARIES Journald::Journald)
endif ()
list(APPEND WTF_SYSTEM_INCLUDE_DIRECTORIES
Copied: trunk/Source/cmake/FindJournald.cmake (from rev 284672, trunk/Source/cmake/FindSystemd.cmake) (0 => 284673)
--- trunk/Source/cmake/FindJournald.cmake (rev 0)
+++ trunk/Source/cmake/FindJournald.cmake 2021-10-22 08:44:02 UTC (rev 284673)
@@ -0,0 +1,99 @@
+# Copyright (C) 2020 Igalia S.L.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
+# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#[=======================================================================[.rst:
+FindJournald
+-----------
+
+Find Journald-compatible headers and libraries.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+``Journald::Journald``
+ The library where Journald symbols reside, if found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This will define the following variables in your project:
+
+``Journald_FOUND``
+ true if (the requested version of) Journald is available.
+``Journald_VERSION``
+ the version of the library where Journald symbols reside.
+``Journald_LIBRARIES``
+ the libraries to link against to use Journald.
+``Journald_INCLUDE_DIRS``
+ where to find the Journald headers.
+``Journald_COMPILE_OPTIONS``
+ this should be passed to target_compile_options(), if the
+ target is not used for linking
+
+#]=======================================================================]
+find_package(PkgConfig QUIET)
+
+# libelogind provides compatible pc and header files
+pkg_check_modules(PC_SYSTEMD QUIET libsystemd)
+set(Journald_COMPILE_OPTIONS ${PC_SYSTEMD_CFLAGS_OTHER})
+set(Journald_VERSION ${PC_SYSTEMD_VERSION})
+
+find_path(Journald_INCLUDE_DIR
+ NAMES systemd/sd-journal.h
+ HINTS ${PC_SYSTEMD_INCLUDEDIR} ${PC_SYSTEMD_INCLUDE_DIRS}
+)
+
+find_library(Journald_LIBRARY
+ NAMES ${Journald_NAMES} systemd
+ HINTS ${PC_SYSTEMD_LIBDIR} ${PC_SYSTEMD_LIBRARY_DIRS}
+)
+
+if (NOT Journald_LIBRARY)
+ find_library(Journald_LIBRARY
+ NAMES ${Journald_NAMES} elogind
+ HINTS ${PC_SYSTEMD_LIBDIR} ${PC_SYSTEMD_LIBRARY_DIRS}
+ )
+endif ()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Journald
+ FOUND_VAR Journald_FOUND
+ REQUIRED_VARS Journald_LIBRARY Journald_INCLUDE_DIR
+ VERSION_VAR Journald_VERSION
+)
+
+if (Journald_LIBRARY AND NOT TARGET Journald::Journald)
+ add_library(Journald::Journald UNKNOWN IMPORTED GLOBAL)
+ set_target_properties(Journald::Journald PROPERTIES
+ IMPORTED_LOCATION "${Journald_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${Journald_COMPILE_OPTIONS}"
+ INTERFACE_INCLUDE_DIRECTORIES "${Journald_INCLUDE_DIR}"
+ )
+endif ()
+
+mark_as_advanced(Journald_INCLUDE_DIR Journald_LIBRARY)
+
+if (Journald_FOUND)
+ set(Journald_LIBRARIES ${Journald_LIBRARY})
+ set(Journald_INCLUDE_DIRS ${Journald_INCLUDE_DIR})
+endif ()
Deleted: trunk/Source/cmake/FindSystemd.cmake (284672 => 284673)
--- trunk/Source/cmake/FindSystemd.cmake 2021-10-22 08:19:07 UTC (rev 284672)
+++ trunk/Source/cmake/FindSystemd.cmake 2021-10-22 08:44:02 UTC (rev 284673)
@@ -1,92 +0,0 @@
-# Copyright (C) 2020 Igalia S.L.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
-# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#[=======================================================================[.rst:
-FindSystemd
------------
-
-Find Systemd headers and libraries.
-
-Imported Targets
-^^^^^^^^^^^^^^^^
-
-``Systemd::Systemd``
- The Systemd library, if found.
-
-Result Variables
-^^^^^^^^^^^^^^^^
-
-This will define the following variables in your project:
-
-``Systemd_FOUND``
- true if (the requested version of) Systemd is available.
-``Systemd_VERSION``
- the version of Systemd.
-``Systemd_LIBRARIES``
- the libraries to link against to use Systemd.
-``Systemd_INCLUDE_DIRS``
- where to find the Systemd headers.
-``Systemd_COMPILE_OPTIONS``
- this should be passed to target_compile_options(), if the
- target is not used for linking
-
-#]=======================================================================]
-
-find_package(PkgConfig QUIET)
-
-pkg_check_modules(PC_SYSTEMD QUIET libsystemd)
-set(Systemd_COMPILE_OPTIONS ${PC_SYSTEMD_CFLAGS_OTHER})
-set(Systemd_VERSION ${PC_SYSTEMD_VERSION})
-
-find_path(Systemd_INCLUDE_DIR
- NAMES systemd/sd-journal.h
- HINTS ${PC_SYSTEMD_INCLUDEDIR} ${PC_SYSTEMD_INCLUDE_DIRS}
-)
-
-find_library(Systemd_LIBRARY
- NAMES ${Systemd_NAMES} systemd
- HINTS ${PC_SYSTEMD_LIBDIR} ${PC_SYSTEMD_LIBRARY_DIRS}
-)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Systemd
- FOUND_VAR Systemd_FOUND
- REQUIRED_VARS Systemd_LIBRARY Systemd_INCLUDE_DIR
- VERSION_VAR Systemd_VERSION
-)
-
-if (Systemd_LIBRARY AND NOT TARGET Systemd::Systemd)
- add_library(Systemd::Systemd UNKNOWN IMPORTED GLOBAL)
- set_target_properties(Systemd::Systemd PROPERTIES
- IMPORTED_LOCATION "${Systemd_LIBRARY}"
- INTERFACE_COMPILE_OPTIONS "${Systemd_COMPILE_OPTIONS}"
- INTERFACE_INCLUDE_DIRECTORIES "${Systemd_INCLUDE_DIR}"
- )
-endif ()
-
-mark_as_advanced(Systemd_INCLUDE_DIR Systemd_LIBRARY)
-
-if (Systemd_FOUND)
- set(Systemd_LIBRARIES ${Systemd_LIBRARY})
- set(Systemd_INCLUDE_DIRS ${Systemd_INCLUDE_DIR})
-endif ()
Modified: trunk/Source/cmake/OptionsGTK.cmake (284672 => 284673)
--- trunk/Source/cmake/OptionsGTK.cmake 2021-10-22 08:19:07 UTC (rev 284672)
+++ trunk/Source/cmake/OptionsGTK.cmake 2021-10-22 08:44:02 UTC (rev 284673)
@@ -56,6 +56,7 @@
WEBKIT_OPTION_DEFINE(ENABLE_GLES2 "Whether to enable OpenGL ES 2.0." PUBLIC ${ENABLE_GLES2_DEFAULT})
WEBKIT_OPTION_DEFINE(ENABLE_GTKDOC "Whether or not to use generate gtkdoc." PUBLIC OFF)
WEBKIT_OPTION_DEFINE(ENABLE_INTROSPECTION "Whether to enable GObject introspection." PUBLIC ON)
+WEBKIT_OPTION_DEFINE(ENABLE_JOURNALD_LOG "Whether to enable journald logging" PUBLIC ON)
WEBKIT_OPTION_DEFINE(ENABLE_QUARTZ_TARGET "Whether to enable support for the Quartz windowing target." PUBLIC ON)
WEBKIT_OPTION_DEFINE(ENABLE_WAYLAND_TARGET "Whether to enable support for the Wayland windowing target." PUBLIC ON)
WEBKIT_OPTION_DEFINE(ENABLE_X11_TARGET "Whether to enable support for the X11 windowing target." PUBLIC ON)
@@ -68,7 +69,6 @@
WEBKIT_OPTION_DEFINE(USE_OPENGL_OR_ES "Whether to use OpenGL or ES." PUBLIC ON)
WEBKIT_OPTION_DEFINE(USE_OPENJPEG "Whether to enable support for JPEG2000 images." PUBLIC ON)
WEBKIT_OPTION_DEFINE(USE_SOUP2 "Whether to enable usage of Soup 2 instead of Soup 3." PUBLIC OFF)
-WEBKIT_OPTION_DEFINE(USE_SYSTEMD "Whether to enable journald logging" PUBLIC ON)
WEBKIT_OPTION_DEFINE(USE_WOFF2 "Whether to enable support for WOFF2 Web Fonts." PUBLIC ON)
WEBKIT_OPTION_DEFINE(USE_WPE_RENDERER "Whether to enable WPE rendering" PUBLIC ON)
@@ -455,13 +455,13 @@
endif ()
endif ()
-if (USE_SYSTEMD)
- find_package(Systemd)
- if (Systemd_FOUND)
- message(STATUS "Release logs will be sent to the Systemd journal")
- SET_AND_EXPOSE_TO_BUILD(USE_JOURNALD TRUE)
+if (ENABLE_JOURNALD_LOG)
+ find_package(Journald)
+ if (Journald_FOUND)
+ message(STATUS "Release logs will be sent using journald logging interface")
+ SET_AND_EXPOSE_TO_BUILD(ENABLE_JOURNALD_LOG TRUE)
else ()
- message(FATAL_ERROR "libsystemd is needed for USE_SYSTEMD")
+ message(FATAL_ERROR "libsystemd or libelogind are needed for ENABLE_JOURNALD_LOG")
endif ()
endif ()
Modified: trunk/Source/cmake/OptionsWPE.cmake (284672 => 284673)
--- trunk/Source/cmake/OptionsWPE.cmake 2021-10-22 08:19:07 UTC (rev 284672)
+++ trunk/Source/cmake/OptionsWPE.cmake 2021-10-22 08:44:02 UTC (rev 284673)
@@ -73,12 +73,12 @@
# there is a strong reason we should support changing the value of the option,
# and the option is not relevant to any other WebKit ports.
WEBKIT_OPTION_DEFINE(ENABLE_GTKDOC "Whether or not to use generate gtkdoc." PUBLIC OFF)
+WEBKIT_OPTION_DEFINE(ENABLE_JOURNALD_LOG "Whether to enable journald logging" PUBLIC ON)
WEBKIT_OPTION_DEFINE(ENABLE_WPE_QT_API "Whether to enable support for the Qt5/QML plugin" PUBLIC ${ENABLE_DEVELOPER_MODE})
WEBKIT_OPTION_DEFINE(USE_AVIF "Whether to enable support for AVIF images." PUBLIC ${ENABLE_EXPERIMENTAL_FEATURES})
WEBKIT_OPTION_DEFINE(USE_LCMS "Whether to enable support for image color management using libcms2." PUBLIC ON)
WEBKIT_OPTION_DEFINE(USE_OPENJPEG "Whether to enable support for JPEG2000 images." PUBLIC ON)
WEBKIT_OPTION_DEFINE(USE_SOUP2 "Whether to enable usage of Soup 2 instead of Soup 3." PUBLIC OFF)
-WEBKIT_OPTION_DEFINE(USE_SYSTEMD "Whether to enable journald logging" PUBLIC ON)
WEBKIT_OPTION_DEFINE(USE_WOFF2 "Whether to enable support for WOFF2 Web Fonts." PUBLIC ON)
# Private options specific to the WPE port.
@@ -232,13 +232,13 @@
endif ()
endif ()
-if (USE_SYSTEMD)
- find_package(Systemd)
- if (Systemd_FOUND)
- message(STATUS "Release logs will be sent to the Systemd journal")
- SET_AND_EXPOSE_TO_BUILD(USE_JOURNALD TRUE)
+if (ENABLE_JOURNALD_LOG)
+ find_package(Journald)
+ if (Journald_FOUND)
+ message(STATUS "Release logs will be sent using journald logging interface")
+ SET_AND_EXPOSE_TO_BUILD(ENABLE_JOURNALD_LOG TRUE)
else ()
- message(FATAL_ERROR "libsystemd is needed for USE_SYSTEMD")
+ message(FATAL_ERROR "libsystemd or libelogind are needed for ENABLE_JOURNALD_LOG")
endif ()
endif ()