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.args.init_logging(args: Namespace, default_format: str = '%(name)-36s - %(levelname)-6s - %(message)s') None[source]#

Initialize logging based on command-line arguments.

vcorelib.logging.args.logging_args(parser: ArgumentParser, curses: bool = True, uvloop: bool = True) None[source]#

Add logging related command-line arguments to a parser.

vcorelib.logging.time module#

A module with interfaces for time and logging integration.

vcorelib.logging.time.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.

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.

vcorelib.logging.logging_args(parser: ArgumentParser, curses: bool = True, uvloop: bool = True) None[source]#

Add logging related command-line arguments to a parser.

vcorelib.logging.normalize(logger: Logger | LoggerAdapter[Any]) Logger[source]#

Normalize a logger instance.