Bug 232080

Summary: [WPE][GTK] Enable logging under non-systemd linux distros
Product: WebKit Reporter: ablocorrea
Component: CMakeAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, benjamin, bugs-noreply, cdumez, cmarcelo, ews-watchlist, gyuyoung.kim, mcatanzaro, pnormand, ryuan.choi, sergio
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Linux   
See Also: https://bugs.webkit.org/show_bug.cgi?id=235339
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description ablocorrea 2021-10-21 08:00:38 PDT
For linux distributions which do not use systemd, there exists an alternative login deamon, elogind, which is commonly used. elogind is compatible with systemd's journald interface. Renaming the `USE_SYSTEMD` configuration option to `ENABLE_JOURNALD_LOG` and adding the possibility to detect libelogind, would allow such distros to build with logging enabled.
Comment 1 ablocorrea 2021-10-21 08:06:22 PDT
Created attachment 442024 [details]
Patch
Comment 2 ablocorrea 2021-10-21 08:19:43 PDT
Created attachment 442026 [details]
Patch
Comment 3 Michael Catanzaro 2021-10-21 08:29:15 PDT
Comment on attachment 442026 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=442026&action=review

> w/Source/WTF/wtf/Logger.h:244
> -#if USE(SYSTEMD)
> +#if USE(JOURNALD)

If you're changing the name of the public build option to ENABLE_JOURNALD_LOG, then also change its usage in the code to ENABLE(JOURNALD_LOG).

> w/Source/cmake/OptionsWPE.cmake:240
>          SET_AND_EXPOSE_TO_BUILD(USE_JOURNALD TRUE)

Then here you would SET_AND_EXPOSE_TO_BUILD(ENABLE_JOURNALD_LOG TRUE)
Comment 4 ablocorrea 2021-10-21 08:49:54 PDT
Created attachment 442031 [details]
Patch
Comment 5 ablocorrea 2021-10-21 08:52:05 PDT
(In reply to Michael Catanzaro from comment #3)
> Comment on attachment 442026 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=442026&action=review
> 
> > w/Source/WTF/wtf/Logger.h:244
> > -#if USE(SYSTEMD)
> > +#if USE(JOURNALD)
> 
> If you're changing the name of the public build option to
> ENABLE_JOURNALD_LOG, then also change its usage in the code to
> ENABLE(JOURNALD_LOG).
> 
> > w/Source/cmake/OptionsWPE.cmake:240
> >          SET_AND_EXPOSE_TO_BUILD(USE_JOURNALD TRUE)
> 
> Then here you would SET_AND_EXPOSE_TO_BUILD(ENABLE_JOURNALD_LOG TRUE)

Makes sense and should also help tracking the source of the macro. Consequently, I have also renamed all entries of USE(JOURNALD) to ENABLE(JOURNALD_LOG)
Comment 6 Michael Catanzaro 2021-10-21 09:16:15 PDT
Phil, any objections? The patch looks good to me.
Comment 7 EWS 2021-10-22 01:44:08 PDT
Committed r284673 (243393@main): <https://commits.webkit.org/243393@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 442031 [details].