Module DynAIkonTrap.logging
Provides access to a preset Python logger. To use call get_logger()
once at the start of the file with the parameter set to __name__
. Doing so ensures the logging output displays which module a log message was generated in.
Example usage:
logger = get_logger(__name__)
logger.error('A dreadful thing is happening')
Functions
def get_logger(name: str) ‑> logging.Logger
-
Creates a
Logger
instance with messages set to print the path according toname
. The function should always be called with__name__
Args
name
:str
- file path as given by
__name__
Returns
Logger
- A
Logger
instance. Call the standard info, warning, error, etc. functions to generate