vcorelib.logging
index
/home/vkottler/src/vkottler/workspace/vcorelib/vcorelib/logging/__init__.py

Utilities for logging information.

 
Package Contents
       
args
time

 
Classes
       
builtins.object
LoggerMixin

 
class LoggerMixin(builtins.object)
    LoggerMixin(logger: Union[logging.Logger, logging.LoggerAdapter[Any]] = None, logger_name: str = None) -> None
 
A class that provides an inheriting class a logger attribute.
 
  Methods defined here:
__init__(self, logger: Union[logging.Logger, logging.LoggerAdapter[Any]] = None, logger_name: str = None) -> None
Initialize this object with logging capabilities.
log_time(self, message: str, *args, level: int = 20, reminder: bool = False, **kwargs) -> Iterator[NoneType]
A simple wrapper.

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__annotations__ = {'logger': typing.Union[logging.Logger, logging.LoggerAdapter[typing.Any]]}

 
Functions
       
forward_flags(args: argparse.Namespace, names: Iterable[str]) -> Iterator[str]
Forward flag arguments.
forward_logging_flags(args: argparse.Namespace) -> Iterator[str]
Forward logging-related flags passed to this program to some other
program.
init_logging(args: argparse.Namespace, default_format: str = '%(name)-36s - %(levelname)-6s - %(message)s') -> None
Initialize logging based on command-line arguments.
log_time(log: Union[logging.Logger, logging.LoggerAdapter[Any]], message: str, *args, level: int = 20, reminder: bool = False, **kwargs) -> Iterator[NoneType]
A simple context manager for conveniently logging time taken for a task.
logging_args(parser: argparse.ArgumentParser, curses: bool = True, uvloop: bool = True) -> None
Add logging related command-line arguments to a parser.
normalize(logger: Union[logging.Logger, logging.LoggerAdapter[Any]]) -> logging.Logger
Normalize a logger instance.

 
Data
        DEFAULT_FORMAT = '%(name)-36s - %(levelname)-6s - %(message)s'
DEFAULT_TIME_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
LogRecordQueue = _queue.SimpleQueue[logging.LogRecord]
LoggerType = typing.Union[logging.Logger, logging.LoggerAdapter[typing.Any]]
TIMER = <vcorelib.math.time.Timer object>
__all__ = ['LoggerType', 'log_time', 'LoggerMixin', 'TIMER', 'LogRecordQueue', 'normalize', 'DEFAULT_FORMAT', 'DEFAULT_TIME_FORMAT', 'init_logging', 'logging_args', 'forward_flags', 'forward_logging_flags']