mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-02 19:32:34 +01:00
fw/config: add logging to parsers
Add logging to config/agenda parsing.
This commit is contained in:
committed by
Marc Bonnici
parent
3b7debe676
commit
f19ca4c00c
@@ -12,6 +12,13 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import logging
|
||||
|
||||
from wa.utils import log
|
||||
|
||||
|
||||
logger = logging.getLogger('config')
|
||||
|
||||
|
||||
class JobSpecSource(object):
|
||||
|
||||
@@ -20,6 +27,7 @@ class JobSpecSource(object):
|
||||
def __init__(self, config, parent=None):
|
||||
self.config = config
|
||||
self.parent = parent
|
||||
self._log_self()
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
@@ -28,6 +36,15 @@ class JobSpecSource(object):
|
||||
def name(self):
|
||||
raise NotImplementedError()
|
||||
|
||||
def _log_self(self):
|
||||
logger.debug('Creating {} node'.format(self.kind))
|
||||
log.indent()
|
||||
try:
|
||||
for key, value in self.config.iteritems():
|
||||
logger.debug('"{}" to "{}"'.format(key, value))
|
||||
finally:
|
||||
log.dedent()
|
||||
|
||||
|
||||
class WorkloadEntry(JobSpecSource):
|
||||
kind = "workload"
|
||||
|
Reference in New Issue
Block a user