ngs_tools.logging
Module Contents
Classes
Custom logger that provides namespacing functionality. |
Functions
|
Given a logger name, silence it completely. |
|
Set the logger to the provided |
Attributes
- ngs_tools.logging.silence_logger(name: str)
Given a logger name, silence it completely.
- Parameters:
name – Logger name to silence
- class ngs_tools.logging.Logger(name: Optional[str] = None)
Custom logger that provides namespacing functionality.
- The following loggers are silenced by default:
anndata, h5py, numba, pysam, pystan
- FORMAT
Static attribute that encodes the logging format string
- logger
The logger object
- ch
A
logging.Streamhandler
object that sets the format
- FORMAT = '[%(asctime)s] %(levelname)7s %(message)s'
- namespaced(namespace: str)
Function decorator to set the logging namespace for the duration of the function.
- Parameters:
namespace – The namespace
- namespaced_context(namespace: str)
Context manager to set the logging namespace.
- Parameters:
namespace – The namespace
- namespace_message(message: str) str
Add namespace information at the beginning of the logging message.
- Parameters:
message – The logging message
- Returns:
The namespaced message
- addHandler(hdlr: logging.Handler, format: bool = True)
- removeHandler(*args, **kwargs)
- setLevel(*args, **kwargs)
- debug(message, *args, **kwargs)
- info(message, *args, **kwargs)
- warning(message, *args, **kwargs)
- exception(message, *args, **kwargs)
- critical(message, *args, **kwargs)
- error(message, *args, **kwargs)
- ngs_tools.logging.logger