Skip to content

Commit

Permalink
!cleanup: Remove unused and confusing GALLIA_LOGLEVEL variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rumpelsepp committed Nov 8, 2024
1 parent eb52ade commit 1eb4d76
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
7 changes: 0 additions & 7 deletions docs/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ GALLIA_CONFIG
: The path to the config file usually called `gallia.toml`.
Disables autodiscovery of the config.

GALLIA_LOGLEVEL
: When {meth}`gallia.log.setup_logging()` is called without an argument this environment variable is read to set the loglevel.
Supported value are: `trace`, `debug`, `info`, `notice`, `warning`, `error`, `critical`.
As an alternative, the int values from 0 to 7 can be used.
Mostly useful in own scripts or tests.
This variable is not read when using the gallia cli.

GALLIA_LOGGING_SYSTEMD
: Tells gallia to omit colors and status bars in logging output.
Additionally, the priority information gets added such that the journal can add it.
Expand Down
8 changes: 1 addition & 7 deletions src/gallia/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,12 @@ def setup_logging(
logging.
:param level: The loglevel to enable for the console handler.
If this argument is None, the env variable
``GALLIA_LOGLEVEL`` (see :doc:`../env`) is read.
:param file_level: The loglevel to enable for the file handler.
:param path: The path to the logfile containing json records.
:param color_mode: The color mode to use for the console.
"""
if level is None:
# FIXME why is this here and not in config?
if (raw := os.getenv("GALLIA_LOGLEVEL")) is not None:
level = PenlogPriority.from_str(raw).to_level()
else:
level = Loglevel.DEBUG
level = Loglevel.DEBUG

# These are slow and not used by gallia.
logging.logMultiprocessing = False
Expand Down

0 comments on commit 1eb4d76

Please sign in to comment.