log

Decorators

timings_logged

Decorater to log: caller, called and passed time.

timings

Default timings_logged() decorator

Additional Logging Level

add_logging_level_timings

Logging level to report computational timings.

TimingsFilter

Filter out everything but logging.TIMINGS.

Logging Setup

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 by logger.getLogger(__name__). If None provided, decorated function’s module is used. (As in getLogger(func.__module__))

  • uexp (int, default=3) – Time resolution modifier as in 1e-uexp seconds. 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 filter to only log timing events for keeping the log as clean as possible.

class tessif.write.log.TimingsFilter(name='')[source]

Bases: Filter

Filter out everything but logging.TIMINGS.

filter(record)[source]

Determine if the specified record is to be logged.

Is the specified record to be logged? Returns 0 for no, nonzero for yes. If deemed appropriate, the record may be modified in-place.

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: