
Simon McVittie
authored
This has three main functions:
- If stdout and/or stderr are /dev/null, send warnings to the systemd
Journal so they don't get lost, along with debug messages if enabled.
- If the user requests it, redirect stdout and/or stderr to the systemd
Journal so that everything will be logged in one place.
- If stdout and/or stderr is already a Journal file descriptor
inherited from a parent process, reopen it with our own details, and
send our log messages with a bit more metadata.
This obsoletes _srt_util_set_up_logging(), which did the first two
of those.
This is a per-application opt-in, because each application that will make
use of this needs to be aware that it might redirect stdout and stderr.
Signed-off-by:
Simon McVittie <smcv@collabora.com>