From d68a4e7ccf576cde38a9569e328341375bc8bc4e Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Tue, 28 Dec 2010 10:02:49 -0700 Subject: [PATCH] bb.debug: handle caller not passing a debug level This is a compatibility measure, as previous versions did not error out when this occurred, and will most likely be dropped in the next bitbake minor version in favor of a fatal error. Signed-off-by: Chris Larson --- lib/bb/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/bb/__init__.py b/lib/bb/__init__.py index f8577c6794c..3e75abd28b5 100644 --- a/lib/bb/__init__.py +++ b/lib/bb/__init__.py @@ -76,6 +76,10 @@ def plain(*args): logger.plain(''.join(args)) def debug(lvl, *args): + if isinstance(lvl, basestring): + logger.warn("Passed invalid debug level '%s' to bb.debug", lvl) + args = (lvl,) + args + lvl = 1 logger.debug(lvl, ''.join(args)) def note(*args): -- 2.47.3