1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-07-08 16:13:27 +01:00

framework: set context for loggers

Set context for the loggers of the Runner, the workloads and the
installed instruments and processors. Errors/warnings logged by these
entities will be automatically added as events.
This commit is contained in:
Sergei Trofimov
2017-10-23 12:25:10 +01:00
parent 47d883de09
commit 8dd1e6636c
4 changed files with 8 additions and 4 deletions

@ -33,10 +33,11 @@ class ProcessorManager(object):
self.logger = logging.getLogger('processor')
self.processors = []
def install(self, processor):
def install(self, processor, context):
if not isinstance(processor, ResultProcessor):
processor = self.loader.get_result_processor(processor)
self.logger.debug('Installing {}'.format(processor.name))
processor.logger.context = context
self.processors.append(processor)
def validate(self):