amici.logging
Logging
This module provides custom logging functionality for other amici modules
Functions
|
Returns (if extistant) or creates an AMICI logger |
|
Parameterized function decorator that enables automatic execution time tracking |
|
- amici.logging.get_logger(logger_name='amici', log_level=None, **kwargs)[source]
Returns (if extistant) or creates an AMICI logger
If the AMICI base logger has already been set up, this method will return it or any of its descendant loggers without overriding the settings - i.e. any values supplied as kwargs will be ignored.
- Parameters:
logger_name (
str
|None
) – Get a logger for a specific namespace, typically __name__ for code outside of classes or self.__module__ inside a classlog_level (
int
|None
) – Override the default or preset log level for the requested logger. None or False uses the default or preset value. True evaluates to logging.DEBUG. Any integer is used directly.console_output – Set up a default console log handler if True (default). Only used when the AMICI logger hasn’t been set up yet.
file_output – Supply a filename to copy all log output to that file, or set to False to disable (default). Only used when the AMICI logger hasn’t been set up yet.
capture_warnings – Capture warnings from Python’s warnings module if True (default). Only used when the AMICI logger hasn’t been set up yet..
- Return type:
- Returns:
A logging.Logger object with the requested name
- amici.logging.log_execution_time(description, logger)[source]
Parameterized function decorator that enables automatic execution time tracking
- Parameters:
description (
str
) – Description of what the decorated function doeslogger (
logging.Logger
) – Logger to which execution timing will be printed
- Return type: