mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
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 <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
7283a0b3b6
commit
75f87db413
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user