Implement journald logging
In my system log, there are a few lines like this:
pipewire[5491]: [W][000104645.232831][main-loop.c:157 pw_main_loop_run()] main-loop 0x561c88f2d420: iterate error -4 (Interrupted system call)
main-loop.c:157 pw_main_loop_run()
is here. The pw_loop_iterate()
call seems to end up here.
Now, of course, interrupted system calls are not errors or failures in the usual sense, and they can happen for a variety of reasons (in my case, I was closing my laptop's lid). It's usually appropriate to just retry a failed call if it results EINTR
. I don't know enough of PipeWire internals to say whether it should be spa_system_pollfd_wait()
, loop_iterate()
, or some other code that retries polling on EINTR
, but it should not be treated like other errors and logged to the system log.
P.S. This system I'm running PipeWire on also uses systemd-journald for logging, which has native support for structured logging, where things like the source file/line/function (here, main-loop.c:157 pw_main_loop_run()
), priority (here, W
) and errno (here, -4 (Interrupted system call)
) can be expressed as native log entry fields, as opposed to just formatting them into the log message. I see PipeWire already has optional support for systemd integration (namely for socket activation). Would it be possible to also make the logging implementation optionally integrate with journald? I volunteer to contribute an implementation of this