Logging

The HGDL package uses the Loguru library for sophisticated log management. This follows similar principles as the vanilla Python logging framework, with additional functionality and performance benefits. You may want to enable logging in interactive use, or for debugging purposes.

Configuring logging

To enable logging in HGDL:

from loguru import logger
logger.enable("hgdl")

To configure the logging level:

logger.add(sys.stderr, filter="hgdl", level="INFO")

See Python’s reference on levels for more info.

To log to a file:

logger.add("file_{time}.log")

Loguru provides many further options for configuration.