vcorelib.logging package#
Submodules#
vcorelib.logging.args module#
A module implementing command-line option handling for logger initialization.
- vcorelib.logging.args.forward_flags(args: Namespace, names: Iterable[str]) Iterator[str] [source]#
Forward flag arguments.
- vcorelib.logging.args.forward_logging_flags(args: Namespace) Iterator[str] [source]#
Forward logging-related flags passed to this program to some other program.
vcorelib.logging.time module#
A module with interfaces for time and logging integration.
Module contents#
Utilities for logging information.
- class vcorelib.logging.LoggerMixin(logger: Logger | LoggerAdapter[Any] = None, logger_name: str = None)[source]#
Bases:
object
A class that provides an inheriting class a logger attribute.
- log_time(message: str, *args, level: int = 20, reminder: bool = False, **kwargs) Iterator[None] [source]#
A simple wrapper.
- logger: Logger | LoggerAdapter[Any]#
- vcorelib.logging.forward_flags(args: Namespace, names: Iterable[str]) Iterator[str] [source]#
Forward flag arguments.
- vcorelib.logging.forward_logging_flags(args: Namespace) Iterator[str] [source]#
Forward logging-related flags passed to this program to some other program.
- vcorelib.logging.init_logging(args: Namespace, default_format: str = '%(name)-36s - %(levelname)-6s - %(message)s') None [source]#
Initialize logging based on command-line arguments.
- vcorelib.logging.log_time(log: Logger | LoggerAdapter[Any], message: str, *args, level: int = 20, reminder: bool = False, **kwargs) Iterator[None] [source]#
A simple context manager for conveniently logging time taken for a task.