Logger

The first (optional) call from the archivist package is to set the logger.

from archivist.logger import set_logger
from archivist.archivist import Archivist

set_logger("DEBUG")
client_id = getenv("DATATRAILS_APPREG_CLIENT")
client_secret_file = getenv("DATATRAILS_APPREG_SECRET_FILENAME")
with open(client_secret_file, mode="r", encoding="utf-8") as tokenfile:
    client_secret = tokenfile.read().strip()

arch = Archivist(
    "https://app.datatrails.ai",
    (client_id, client_secret),
    max_time=300,
)

Creates the root logger as a simple console streamer. Follows the Django-style logging configuration where the logging system forms a hierarchy of loggers all potentially independently configurable.

This model allows controlling loggers that are part of the dependency list. For example setting a debug logging level will show debug output from the underlying urllib3 package.

URL: https://docs.djangoproject.com/en/3.2/topics/logging/

archivist.logger.set_logger(level)[source]

Set logging level

Parameters:

level (str) -- Either INFO or DEBUG