Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Datamap script: Update logging and switch to low-level S3 client #1480

Merged
merged 4 commits into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions ichnaea/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,19 @@
METRICS = markus.get_metrics()


def configure_logging():
"""Configure Python logging."""
local_dev_env = settings("local_dev_env")
logging_level = settings("logging_level")
def configure_logging(local_dev_env=None, logging_level=None):
"""Configure Python logging.

:param local_dev_env: If True, format logs for humans. If False,
use MozLog format for machines. The default is to read the
value from settings.
:param logging_level: The logging level, such as DEBUG or INFO.
The default is to read the value from settings.
"""
if local_dev_env is None:
local_dev_env = settings("local_dev_env")
if logging_level is None:
logging_level = settings("logging_level")

if local_dev_env:
handlers = ["dev"]
Expand Down
Loading