ape.infrastructure.baseclass.BaseThreadClass

class ape.infrastructure.baseclass.BaseThreadClass

Extends the base-class with a run_thread method that will log tracebacks on exceptions.

This is meant to log errors that kill threads.

__init__()

Methods

__init__()
log_error(error[, message]) Logs the error in bold red
run() This is called by the run_thread() method
run_thread(*args, **kwargs)
param:Whatever self.run accepts

Attributes

logger
return:A logging object.
thread This passes no arguments to run_thread – override if needed
log_error(error, message='')

Logs the error in bold red

Param:
  • error: error type (prefix in red and bold)
  • message: descriptive message (red but not bold)
run()

This is called by the run_thread() method

run_thread(*args, **kwargs)
Param:Whatever self.run accepts
Precondition:self.run method exists and is thread-safe
logger
Returns:A logging object.
thread

This passes no arguments to run_thread – override if needed

Returns:threading.Thread with self.run_thread as target and daemon True

Navigation