mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-06-22 16:26:09 +01:00
utils/log: add indentcontext
Add indentcontext context manager to save having to add try/finally clauses around indenting code just to ensure dedenting.
This commit is contained in:
committed by
Marc Bonnici
parent
c1a0f842d0
commit
ecc68ee367
wa
@ -239,12 +239,9 @@ class ResourceResolver(object):
|
||||
self.logger.debug('Loading getter {}'.format(gettercls.name))
|
||||
getter = self.loader.get_plugin(name=gettercls.name,
|
||||
kind="resource_getter")
|
||||
log.indent()
|
||||
try:
|
||||
with log.indentcontext():
|
||||
getter.initialize()
|
||||
getter.register(self)
|
||||
finally:
|
||||
log.dedent()
|
||||
self.getters.append(getter)
|
||||
|
||||
def register(self, source, priority=SourcePriority.local):
|
||||
|
Reference in New Issue
Block a user