From 7661da1341592d15dee299a0ff24abf9fc542d9e Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 6 Jun 2017 09:22:21 +1000 Subject: [PATCH] Pad state dump Because we append the function/line info after debug lines in the gate logs, the pretty-print ends up not looking all that pretty. Pad it. Change-Id: Ice013428342614300cd51e8b7be56e79b75b31fc --- diskimage_builder/block_device/blockdevice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diskimage_builder/block_device/blockdevice.py b/diskimage_builder/block_device/blockdevice.py index ed2c9587..661cd47e 100644 --- a/diskimage_builder/block_device/blockdevice.py +++ b/diskimage_builder/block_device/blockdevice.py @@ -107,8 +107,8 @@ class BlockDeviceState(collections.MutableMapping): # This is pretty good for human consumption, but maybe a bit # verbose. nice_output = pprint.pformat(self.state, width=40) - for line in nice_output.split('\n'): - logger.debug(" " + line) + for l in nice_output.split('\n'): + logger.debug('{0:{fill}{align}50}'.format(l, fill=' ', align='<')) class BlockDevice(object):