MCPcopy Create free account
hub / github.com/archlinux/archinstall / journal_log

Function journal_log

archinstall/lib/log.py:148–161  ·  view source on GitHub ↗
(message: str, level: int = logging.DEBUG)

Source from the content-addressed store, hash-verified

146
147
148def journal_log(message: str, level: int = logging.DEBUG) -> None:
149 try:
150 import systemd.journal # type: ignore[import-not-found]
151 except ModuleNotFoundError:
152 return
153
154 log_adapter = logging.getLogger('archinstall')
155 log_fmt = logging.Formatter('[%(levelname)s]: %(message)s')
156 log_ch = systemd.journal.JournalHandler()
157 log_ch.setFormatter(log_fmt)
158 log_adapter.addHandler(log_ch)
159 log_adapter.setLevel(logging.DEBUG)
160
161 log_adapter.log(level, message)
162
163
164def info(

Callers 1

logFunction · 0.85

Calls 1

logMethod · 0.80

Tested by

no test coverage detected