CLI: enable log prefixing

This adds a commandline option which enables log level prefixing.
These prefixes enable log level-based filtering in journalctl when
present so long as logs are going to the journal, and
`SyslogLevelPrefix=` is set to `true` (which it is by default).

For documentation: https://manpages.debian.org/testing/libsystemd-dev/sd-daemon.3.en.html
This commit is contained in:
Misty De Méo 2025-02-24 14:53:13 -08:00 committed by Misty De Méo
parent f384d0b830
commit af0f3ed378
3 changed files with 52 additions and 18 deletions

View file

@ -28,7 +28,9 @@ import pytest
import brozzler
args = argparse.Namespace()
arg_parser = argparse.ArgumentParser()
brozzler.cli.add_common_options(arg_parser)
args = arg_parser.parse_args([])
args.log_level = logging.INFO
brozzler.cli.configure_logging(args)