logger ¤
Logging utilities.
Functions:
-
configure_logging
–Configure logging.
-
double_brackets
–Double
{
and}
in log messages to prevent formatting errors. -
log_captured
–Log captured text.
-
redirect_output_to_logging
–Redirect standard output and error to logging.
-
run
–Run a subprocess, log its standard output and error, return its output.
-
tail
–Tail a log file.
configure_logging ¤
configure_logging(
level: str,
path: str | Path | None = None,
*,
include: tuple[str, ...] = (),
exclude: tuple[str, ...] = (),
downgrade: tuple[str, ...] = ()
) -> None
Configure logging.
Parameters:
-
level
(str
) –Log level (name).
-
path
(str | Path | None
, default:None
) –Log file path.
-
include
(tuple[str, ...]
, default:()
) –List of package names for which to show logs.
-
exclude
(tuple[str, ...]
, default:()
) –List of package names for which to hide logs.
-
downgrade
(tuple[str, ...]
, default:()
) –List of package names for which to allow log levels greater or equal to INFO level. Packages that are downgraded will see all their INFO logs demoted to DEBUG level. If unspecified, downgrade every dependency.