log
Decorators
Decorater to log: caller, called and passed time. |
|
Default |
Additional Logging Level
Logging level to report computational timings. |
|
Filter out everything but |
Logging Setup
Convenience wrapper to configure logging behaviour. |
- tessif.write.log.timings_logged(logger=None, uexp=3)[source]
Decorater to log: caller, called and passed time. Specify logging object with logger and resolution as in 1e-uexp seconds.
- Parameters:
logger¶ (
logging.Logger,) – Logger object to use for logging. Usually the one gotten bylogger.getLogger(__name__). If None provided, decorated function’s module is used. (As ingetLogger(func.__module__))uexp¶ (int, default=3) – Time resolution modifier as in
1e-uexpseconds. Default leads to a resolution in milliseconds.
- tessif.write.log.timings(func)
Default
timings_logged()decorator
- tessif.write.log.add_logging_level_timings()[source]
Logging level to report computational timings.
Add a logging level below logging.DEBUG to not annoy any other loggers. Every computational milestone throughout Tessif will be logged on this level.
Logging to this level can be archived by calling
logger.timings().Meant to be used with a
filterto only log timing events for keeping the log as clean as possible.
- class tessif.write.log.TimingsFilter(name='')[source]
Bases:
FilterFilter out everything but
logging.TIMINGS.
- tessif.write.log.supported_logging_levels = ['timings', 'debug', 'info', 'warning', 'error']
Supported logging levels.
- tessif.write.log.logging_levels = {'debug': 'debug', 'error': 'error', 'info': 'info', 'timings': 'timings', 'warning': 'warning'}
Mapping tessifs logging level tags to themselves for failsafe logging level accesss.
- tessif.write.log.setup(debug='/home/docs/checkouts/readthedocs.org/user_builds/tessif-phd/envs/latest/lib/python3.8/site-packages/tessif/write/logs/debug.log', debug_log_logging_level=10, content='/home/docs/checkouts/readthedocs.org/user_builds/tessif-phd/envs/latest/lib/python3.8/site-packages/tessif/write/logs/content.log', content_log_logging_level=20, timings='/home/docs/checkouts/readthedocs.org/user_builds/tessif-phd/envs/latest/lib/python3.8/site-packages/tessif/write/logs/timings.log', timings_log_logging_level=8, log_file_format=None, log_file_time_format=None, stdout_logging_level=20, stdout_logging_format=None)[source]
Convenience wrapper to configure logging behaviour.
- Parameters:
debug¶ (str) – Debug log file’s absolute path. Change default behaviour in
tessif.frused.configurations.logging.debug_log_file_level¶ (int) – Debug loggers logging level. Default = logging.DEBUG. See https://docs.python.org/2/library/logging.html#logging-levels for details on logging levels.
content¶ (str) – Content log file’s absolute path. Change default behaviour in
tessif.frused.paths.content_log_file_level¶ (int) – Content loggers logging level. Default: logging.INFO (20). See https://docs.python.org/2/library/logging.html#logging-levels for details on logging levels.
timings¶ (str) – Timings log file’s absolute path. Change default behaviour in
tessif.frused.paths.timings_log_file_level¶ (int) – Timings loggers logging level. Default: logging.TIMINGS (8). See https://docs.python.org/2/library/logging.html#logging-levels for details on logging levels.
log_file_format¶ (str) – Formatting string for logged messages inside logging files. Default: [{levelname} at {asctime}] {msg}’ i.e.: [TIMINGS at 1986-01-01 00:00:00] This is a Timing log!
log_file_time_format¶ (str) – Formatting string for time indication in logged messages inside logging files. Default: ‘%Y-%m-%d %H:%M:%S’ i.e: 1234-12-24 18:00:59
stdout_logging_level¶ (int) – Standard stream output logging level. Default: logging.INFO(20) See https://docs.python.org/2/library/logging.html#logging-levels for details on logging levels.
stout_logging_format¶ (str) – Formatting string for logged messages sent to stdout. Default: [{levelname} at {asctime}] {msg}’ i.e.: [Info at 1986-01-01 00:00:00] This is a very informative log!