summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Quaresma <quaresma.jose@gmail.com>2022-09-19 09:13:11 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-21 12:22:50 +0100
commitc1d9c1d25ce36848040dc0ce182835e497ccbb82 (patch)
treebd09010ee79abc6c9dfb41d024559745d80ff039
parenteb25cd4d64b9a4e8e2b2ce7fbccc123d00b2fc2b (diff)
downloadbitbake-c1d9c1d25ce36848040dc0ce182835e497ccbb82.tar.gz
lib/bb: warning when the debug message is invalid
There are many messed up calls for the debug log, so is better to warm about this as they will not work as expected. The level need to be an integer and the msg a string. Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/bb/__init__.py b/lib/bb/__init__.py
index 6b470aa19..09fe817ad 100644
--- a/lib/bb/__init__.py
+++ b/lib/bb/__init__.py
@@ -60,6 +60,10 @@ class BBLoggerMixin(object):
return
if loglevel < bb.msg.loggerDefaultLogLevel:
return
+
+ if not isinstance(level, int) or not isinstance(msg, str):
+ mainlogger.warning("Invalid arguments in bbdebug: %s" % repr((level, msg,) + args))
+
return self.log(loglevel, msg, *args, **kwargs)
def plain(self, msg, *args, **kwargs):