binman: Add a bit of logging in entries when packing
Use the new logging feature to log information about progress with
packing. This is useful to see how binman is figuring things out.
Also update elf.py to use the same feature.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/patman/tools.py b/tools/patman/tools.py
index e945b54..f492dc8 100644
--- a/tools/patman/tools.py
+++ b/tools/patman/tools.py
@@ -473,3 +473,19 @@
if entry_name:
args += ['-d', '-e', entry_name]
Run(*args)
+
+def ToHex(val):
+ """Convert an integer value (or None) to a string
+
+ Returns:
+ hex value, or 'None' if the value is None
+ """
+ return 'None' if val is None else '%#x' % val
+
+def ToHexSize(val):
+ """Return the size of an object in hex
+
+ Returns:
+ hex value of size, or 'None' if the value is None
+ """
+ return 'None' if val is None else '%#x' % len(val)