Changeset 284673 in webkit
- Timestamp:
- Oct 22, 2021, 1:44:02 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
- 1 moved
-
ChangeLog (modified) (1 diff)
-
Source/WTF/ChangeLog (modified) (1 diff)
-
Source/WTF/wtf/Assertions.cpp (modified) (1 diff)
-
Source/WTF/wtf/Assertions.h (modified) (3 diffs)
-
Source/WTF/wtf/Logger.h (modified) (4 diffs)
-
Source/WTF/wtf/PlatformGTK.cmake (modified) (1 diff)
-
Source/WTF/wtf/PlatformWPE.cmake (modified) (1 diff)
-
Source/cmake/FindJournald.cmake (moved) (moved from trunk/Source/cmake/FindSystemd.cmake ) (2 diffs)
-
Source/cmake/OptionsGTK.cmake (modified) (3 diffs)
-
Source/cmake/OptionsWPE.cmake (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r284666 r284673 1 2021-10-22 Pablo Correa Gómez <ablocorrea@hotmail.com> 2 3 Enable logging under non-systemd linux distros 4 https://bugs.webkit.org/show_bug.cgi?id=232080 5 6 Reviewed by Michael Catanzaro. 7 8 * Source/cmake/FindJournald.cmake: Renamed from Source/cmake/FindSystemd.cmake. 9 * Source/cmake/OptionsGTK.cmake: Replace USE_SYSTEMD for 10 ENABLE_JOURNALD_LOG 11 * Source/cmake/OptionsWPE.cmake: Replace USE_SYSTEMD for 12 ENABLE_JOURNALD_LOG 13 1 14 2021-10-21 Eric Carlson <eric.carlson@apple.com> 2 15 -
trunk/Source/WTF/ChangeLog
r284634 r284673 1 2021-10-22 Pablo Correa Gómez <ablocorrea@hotmail.com> 2 3 Enable logging in under non-systemd linux distros 4 https://bugs.webkit.org/show_bug.cgi?id=232080 5 6 Reviewed by Michael Catanzaro. 7 8 * wtf/Assertions.h: Rename USE(JOURNALD) to ENABLE(JOURNALD_LOG) 9 * wtf/Logger.h: 10 (WTF::Logger::willLog const): Rename USE(JOURNALD) to 11 ENABLE(JOURNALD_LOG) 12 * wtf/PlatformGTK.cmake: Use renamed Journald library 13 * wtf/PlatformWPE.cmake: Use renamed Journald library 14 1 15 2021-10-21 Aditya Keerthi <akeerthi@apple.com> 2 16 -
trunk/Source/WTF/wtf/Assertions.cpp
r283469 r284673 610 610 else 611 611 out.printf("%-3d %p", frameNumber, stackFrame); 612 #if USE(JOURNALD)612 #if ENABLE(JOURNALD_LOG) 613 613 sd_journal_send("WEBKIT_SUBSYSTEM=%s", channel->subsystem, "WEBKIT_CHANNEL=%s", channel->name, "MESSAGE=%s", out.toCString().data(), nullptr); 614 614 #else -
trunk/Source/WTF/wtf/Assertions.h
r283469 r284673 52 52 #endif 53 53 54 #if USE(JOURNALD)54 #if ENABLE(JOURNALD_LOG) 55 55 #define SD_JOURNAL_SUPPRESS_LOCATION 56 56 #include <systemd/sd-journal.h> … … 99 99 #define RELEASE_LOG_DISABLED 0 100 100 #else 101 #define RELEASE_LOG_DISABLED !(USE(OS_LOG) || USE(JOURNALD))101 #define RELEASE_LOG_DISABLED !(USE(OS_LOG) || ENABLE(JOURNALD_LOG)) 102 102 #endif 103 103 104 104 #ifndef VERBOSE_RELEASE_LOG 105 #define VERBOSE_RELEASE_LOG USE(JOURNALD)105 #define VERBOSE_RELEASE_LOG ENABLE(JOURNALD_LOG) 106 106 #endif 107 107 … … 566 566 } while (0) 567 567 568 #elif USE(JOURNALD)568 #elif ENABLE(JOURNALD_LOG) 569 569 570 570 #define PUBLIC_LOG_STRING "s" -
trunk/Source/WTF/wtf/Logger.h
r283469 r284673 31 31 #include <wtf/text/StringBuilder.h> 32 32 33 #if USE(JOURNALD)33 #if ENABLE(JOURNALD_LOG) 34 34 #define SD_JOURNAL_SUPPRESS_LOCATION 35 35 #include <systemd/sd-journal.h> … … 242 242 return false; 243 243 244 #if USE(SYSTEMD)244 #if ENABLE(JOURNALD_LOG) 245 245 if (channel.state == WTFLogChannelState::Off) 246 246 return false; … … 315 315 #elif USE(OS_LOG) 316 316 os_log(channel.osLogChannel, "%{public}s", logMessage.utf8().data()); 317 #elif USE(JOURNALD)317 #elif ENABLE(JOURNALD_LOG) 318 318 sd_journal_send("WEBKIT_SUBSYSTEM=%s", channel.subsystem, "WEBKIT_CHANNEL=%s", channel.name, "MESSAGE=%s", logMessage.utf8().data(), nullptr); 319 319 #else … … 344 344 UNUSED_PARAM(line); 345 345 UNUSED_PARAM(function); 346 #elif USE(JOURNALD)346 #elif ENABLE(JOURNALD_LOG) 347 347 auto fileString = makeString("CODE_FILE=", file); 348 348 auto lineString = makeString("CODE_LINE=", line); -
trunk/Source/WTF/wtf/PlatformGTK.cmake
r284525 r284673 80 80 ) 81 81 82 if ( Systemd_FOUND)83 list(APPEND WTF_LIBRARIES Systemd::Systemd)82 if (Journald_FOUND) 83 list(APPEND WTF_LIBRARIES Journald::Journald) 84 84 endif () 85 85 -
trunk/Source/WTF/wtf/PlatformWPE.cmake
r284525 r284673 53 53 ) 54 54 55 if ( Systemd_FOUND)56 list(APPEND WTF_LIBRARIES Systemd::Systemd)55 if (Journald_FOUND) 56 list(APPEND WTF_LIBRARIES Journald::Journald) 57 57 endif () 58 58 -
trunk/Source/cmake/FindJournald.cmake
r284672 r284673 23 23 24 24 #[=======================================================================[.rst: 25 Find Systemd25 FindJournald 26 26 ----------- 27 27 28 Find Systemdheaders and libraries.28 Find Journald-compatible headers and libraries. 29 29 30 30 Imported Targets 31 31 ^^^^^^^^^^^^^^^^ 32 32 33 `` Systemd::Systemd``34 The Systemd library, if found.33 ``Journald::Journald`` 34 The library where Journald symbols reside, if found. 35 35 36 36 Result Variables … … 39 39 This will define the following variables in your project: 40 40 41 `` Systemd_FOUND``42 true if (the requested version of) Systemd is available.43 `` Systemd_VERSION``44 the version of Systemd.45 `` Systemd_LIBRARIES``46 the libraries to link against to use Systemd.47 `` Systemd_INCLUDE_DIRS``48 where to find the Systemd headers.49 `` Systemd_COMPILE_OPTIONS``41 ``Journald_FOUND`` 42 true if (the requested version of) Journald is available. 43 ``Journald_VERSION`` 44 the version of the library where Journald symbols reside. 45 ``Journald_LIBRARIES`` 46 the libraries to link against to use Journald. 47 ``Journald_INCLUDE_DIRS`` 48 where to find the Journald headers. 49 ``Journald_COMPILE_OPTIONS`` 50 50 this should be passed to target_compile_options(), if the 51 51 target is not used for linking 52 52 53 53 #]=======================================================================] 54 55 54 find_package(PkgConfig QUIET) 56 55 56 # libelogind provides compatible pc and header files 57 57 pkg_check_modules(PC_SYSTEMD QUIET libsystemd) 58 set( Systemd_COMPILE_OPTIONS ${PC_SYSTEMD_CFLAGS_OTHER})59 set( Systemd_VERSION ${PC_SYSTEMD_VERSION})58 set(Journald_COMPILE_OPTIONS ${PC_SYSTEMD_CFLAGS_OTHER}) 59 set(Journald_VERSION ${PC_SYSTEMD_VERSION}) 60 60 61 find_path( Systemd_INCLUDE_DIR61 find_path(Journald_INCLUDE_DIR 62 62 NAMES systemd/sd-journal.h 63 63 HINTS ${PC_SYSTEMD_INCLUDEDIR} ${PC_SYSTEMD_INCLUDE_DIRS} 64 64 ) 65 65 66 find_library( Systemd_LIBRARY67 NAMES ${ Systemd_NAMES} systemd66 find_library(Journald_LIBRARY 67 NAMES ${Journald_NAMES} systemd 68 68 HINTS ${PC_SYSTEMD_LIBDIR} ${PC_SYSTEMD_LIBRARY_DIRS} 69 69 ) 70 70 71 include(FindPackageHandleStandardArgs) 72 find_package_handle_standard_args(Systemd 73 FOUND_VAR Systemd_FOUND 74 REQUIRED_VARS Systemd_LIBRARY Systemd_INCLUDE_DIR 75 VERSION_VAR Systemd_VERSION 76 ) 77 78 if (Systemd_LIBRARY AND NOT TARGET Systemd::Systemd) 79 add_library(Systemd::Systemd UNKNOWN IMPORTED GLOBAL) 80 set_target_properties(Systemd::Systemd PROPERTIES 81 IMPORTED_LOCATION "${Systemd_LIBRARY}" 82 INTERFACE_COMPILE_OPTIONS "${Systemd_COMPILE_OPTIONS}" 83 INTERFACE_INCLUDE_DIRECTORIES "${Systemd_INCLUDE_DIR}" 71 if (NOT Journald_LIBRARY) 72 find_library(Journald_LIBRARY 73 NAMES ${Journald_NAMES} elogind 74 HINTS ${PC_SYSTEMD_LIBDIR} ${PC_SYSTEMD_LIBRARY_DIRS} 84 75 ) 85 76 endif () 86 77 87 mark_as_advanced(Systemd_INCLUDE_DIR Systemd_LIBRARY) 78 include(FindPackageHandleStandardArgs) 79 find_package_handle_standard_args(Journald 80 FOUND_VAR Journald_FOUND 81 REQUIRED_VARS Journald_LIBRARY Journald_INCLUDE_DIR 82 VERSION_VAR Journald_VERSION 83 ) 88 84 89 if (Systemd_FOUND) 90 set(Systemd_LIBRARIES ${Systemd_LIBRARY}) 91 set(Systemd_INCLUDE_DIRS ${Systemd_INCLUDE_DIR}) 85 if (Journald_LIBRARY AND NOT TARGET Journald::Journald) 86 add_library(Journald::Journald UNKNOWN IMPORTED GLOBAL) 87 set_target_properties(Journald::Journald PROPERTIES 88 IMPORTED_LOCATION "${Journald_LIBRARY}" 89 INTERFACE_COMPILE_OPTIONS "${Journald_COMPILE_OPTIONS}" 90 INTERFACE_INCLUDE_DIRECTORIES "${Journald_INCLUDE_DIR}" 91 ) 92 92 endif () 93 94 mark_as_advanced(Journald_INCLUDE_DIR Journald_LIBRARY) 95 96 if (Journald_FOUND) 97 set(Journald_LIBRARIES ${Journald_LIBRARY}) 98 set(Journald_INCLUDE_DIRS ${Journald_INCLUDE_DIR}) 99 endif () -
trunk/Source/cmake/OptionsGTK.cmake
r284238 r284673 57 57 WEBKIT_OPTION_DEFINE(ENABLE_GTKDOC "Whether or not to use generate gtkdoc." PUBLIC OFF) 58 58 WEBKIT_OPTION_DEFINE(ENABLE_INTROSPECTION "Whether to enable GObject introspection." PUBLIC ON) 59 WEBKIT_OPTION_DEFINE(ENABLE_JOURNALD_LOG "Whether to enable journald logging" PUBLIC ON) 59 60 WEBKIT_OPTION_DEFINE(ENABLE_QUARTZ_TARGET "Whether to enable support for the Quartz windowing target." PUBLIC ON) 60 61 WEBKIT_OPTION_DEFINE(ENABLE_WAYLAND_TARGET "Whether to enable support for the Wayland windowing target." PUBLIC ON) … … 69 70 WEBKIT_OPTION_DEFINE(USE_OPENJPEG "Whether to enable support for JPEG2000 images." PUBLIC ON) 70 71 WEBKIT_OPTION_DEFINE(USE_SOUP2 "Whether to enable usage of Soup 2 instead of Soup 3." PUBLIC OFF) 71 WEBKIT_OPTION_DEFINE(USE_SYSTEMD "Whether to enable journald logging" PUBLIC ON)72 72 WEBKIT_OPTION_DEFINE(USE_WOFF2 "Whether to enable support for WOFF2 Web Fonts." PUBLIC ON) 73 73 WEBKIT_OPTION_DEFINE(USE_WPE_RENDERER "Whether to enable WPE rendering" PUBLIC ON) … … 456 456 endif () 457 457 458 if ( USE_SYSTEMD)459 find_package( Systemd)460 if ( Systemd_FOUND)461 message(STATUS "Release logs will be sent to the Systemd journal")462 SET_AND_EXPOSE_TO_BUILD( USE_JOURNALDTRUE)458 if (ENABLE_JOURNALD_LOG) 459 find_package(Journald) 460 if (Journald_FOUND) 461 message(STATUS "Release logs will be sent using journald logging interface") 462 SET_AND_EXPOSE_TO_BUILD(ENABLE_JOURNALD_LOG TRUE) 463 463 else () 464 message(FATAL_ERROR "libsystemd is needed for USE_SYSTEMD")464 message(FATAL_ERROR "libsystemd or libelogind are needed for ENABLE_JOURNALD_LOG") 465 465 endif () 466 466 endif () -
trunk/Source/cmake/OptionsWPE.cmake
r284603 r284673 74 74 # and the option is not relevant to any other WebKit ports. 75 75 WEBKIT_OPTION_DEFINE(ENABLE_GTKDOC "Whether or not to use generate gtkdoc." PUBLIC OFF) 76 WEBKIT_OPTION_DEFINE(ENABLE_JOURNALD_LOG "Whether to enable journald logging" PUBLIC ON) 76 77 WEBKIT_OPTION_DEFINE(ENABLE_WPE_QT_API "Whether to enable support for the Qt5/QML plugin" PUBLIC ${ENABLE_DEVELOPER_MODE}) 77 78 WEBKIT_OPTION_DEFINE(USE_AVIF "Whether to enable support for AVIF images." PUBLIC ${ENABLE_EXPERIMENTAL_FEATURES}) … … 79 80 WEBKIT_OPTION_DEFINE(USE_OPENJPEG "Whether to enable support for JPEG2000 images." PUBLIC ON) 80 81 WEBKIT_OPTION_DEFINE(USE_SOUP2 "Whether to enable usage of Soup 2 instead of Soup 3." PUBLIC OFF) 81 WEBKIT_OPTION_DEFINE(USE_SYSTEMD "Whether to enable journald logging" PUBLIC ON)82 82 WEBKIT_OPTION_DEFINE(USE_WOFF2 "Whether to enable support for WOFF2 Web Fonts." PUBLIC ON) 83 83 … … 233 233 endif () 234 234 235 if ( USE_SYSTEMD)236 find_package( Systemd)237 if ( Systemd_FOUND)238 message(STATUS "Release logs will be sent to the Systemd journal")239 SET_AND_EXPOSE_TO_BUILD( USE_JOURNALDTRUE)235 if (ENABLE_JOURNALD_LOG) 236 find_package(Journald) 237 if (Journald_FOUND) 238 message(STATUS "Release logs will be sent using journald logging interface") 239 SET_AND_EXPOSE_TO_BUILD(ENABLE_JOURNALD_LOG TRUE) 240 240 else () 241 message(FATAL_ERROR "libsystemd is needed for USE_SYSTEMD")241 message(FATAL_ERROR "libsystemd or libelogind are needed for ENABLE_JOURNALD_LOG") 242 242 endif () 243 243 endif ()
Note:
See TracChangeset
for help on using the changeset viewer.