From 75f87db413f3659fee18eff389b7b339b01cce15 Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Tue, 9 Feb 2021 09:50:21 -0600 Subject: bitbake: logging: Make bitbake logger compatible with python logger The bitbake logger overrode the definition of the debug() logging call to include a debug level, but this causes problems with code that may be using standard python logging, since the extra argument is interpreted differently. Instead, change the bitbake loggers debug() call to match the python logger call and add a debug2() and debug3() API to replace calls that were logging to a different debug level. [RP: Small fix to ensure bb.debug calls bbdebug()] (Bitbake rev: f68682a79d83e6399eb403f30a1f113516575f51) Signed-off-by: Joshua Watt Signed-off-by: Richard Purdie --- bitbake/lib/layerindexlib/tests/restapi.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'bitbake/lib/layerindexlib/tests/restapi.py') diff --git a/bitbake/lib/layerindexlib/tests/restapi.py b/bitbake/lib/layerindexlib/tests/restapi.py index 4646d01f9f..33b5c1c4c8 100644 --- a/bitbake/lib/layerindexlib/tests/restapi.py +++ b/bitbake/lib/layerindexlib/tests/restapi.py @@ -57,11 +57,11 @@ class LayerIndexWebRestApiTest(LayersTest): type in self.layerindex.indexes[0].config['local']: continue for id in getattr(self.layerindex.indexes[0], type): - self.logger.debug(1, "type %s" % (type)) + self.logger.debug("type %s" % (type)) self.assertTrue(id in getattr(reload.indexes[0], type), msg="Id number not in reloaded index") - self.logger.debug(1, "%s ? %s" % (getattr(self.layerindex.indexes[0], type)[id], getattr(reload.indexes[0], type)[id])) + self.logger.debug("%s ? %s" % (getattr(self.layerindex.indexes[0], type)[id], getattr(reload.indexes[0], type)[id])) self.assertEqual(getattr(self.layerindex.indexes[0], type)[id], getattr(reload.indexes[0], type)[id], msg="Reloaded contents different") @@ -80,11 +80,11 @@ class LayerIndexWebRestApiTest(LayersTest): type in self.layerindex.indexes[0].config['local']: continue for id in getattr(self.layerindex.indexes[0] ,type): - self.logger.debug(1, "type %s" % (type)) + self.logger.debug("type %s" % (type)) self.assertTrue(id in getattr(reload.indexes[0], type), msg="Id number missing from reloaded data") - self.logger.debug(1, "%s ? %s" % (getattr(self.layerindex.indexes[0] ,type)[id], getattr(reload.indexes[0], type)[id])) + self.logger.debug("%s ? %s" % (getattr(self.layerindex.indexes[0] ,type)[id], getattr(reload.indexes[0], type)[id])) self.assertEqual(getattr(self.layerindex.indexes[0] ,type)[id], getattr(reload.indexes[0], type)[id], msg="reloaded data does not match original") @@ -111,14 +111,14 @@ class LayerIndexWebRestApiTest(LayersTest): if dep.layer.name == 'meta-python': break else: - self.logger.debug(1, "meta-python was not found") + self.logger.debug("meta-python was not found") raise self.failureException # Only check the first element... break else: # Empty list, this is bad. - self.logger.debug(1, "Empty list of dependencies") + self.logger.debug("Empty list of dependencies") self.assertIsNotNone(first, msg="Empty list of dependencies") # Last dep should be the requested item @@ -128,7 +128,7 @@ class LayerIndexWebRestApiTest(LayersTest): @skipIfNoNetwork() def test_find_collection(self): def _check(collection, expected): - self.logger.debug(1, "Looking for collection %s..." % collection) + self.logger.debug("Looking for collection %s..." % collection) result = self.layerindex.find_collection(collection) if expected: self.assertIsNotNone(result, msg="Did not find %s when it should be there" % collection) @@ -148,11 +148,11 @@ class LayerIndexWebRestApiTest(LayersTest): @skipIfNoNetwork() def test_find_layerbranch(self): def _check(name, expected): - self.logger.debug(1, "Looking for layerbranch %s..." % name) + self.logger.debug("Looking for layerbranch %s..." % name) for index in self.layerindex.indexes: for layerbranchid in index.layerBranches: - self.logger.debug(1, "Present: %s" % index.layerBranches[layerbranchid].layer.name) + self.logger.debug("Present: %s" % index.layerBranches[layerbranchid].layer.name) result = self.layerindex.find_layerbranch(name) if expected: self.assertIsNotNone(result, msg="Did not find %s when it should be there" % collection) -- cgit v1.2.3-54-g00ecf