If we're not going to be printing the formatted data in the log, don't
bother calculating it. On my system, this speeds up the loading of
polar-graphs-demo.pxp by a factor of 10.
for f in self.fields:
_LOG.debug('parsing {!r}.{} (count={}, item_count={})'.format(
self, f, f.count, f.item_count))
- _LOG.debug('data:\n{}'.format(_pprint.pformat(data)))
+ if _LOG.level <= _logging.DEBUG:
+ _LOG.debug('data:\n{}'.format(_pprint.pformat(data)))
if hasattr(f, 'pre_unpack'):
_LOG.debug('pre-unpack {}'.format(f))
f.pre_unpack(parents=parents, data=data)