[bitbake-devel,3/3] tinfoil: enable client-side logger handling by default

Submitted by Paul Eggleton on March 27, 2017, 12:17 a.m. | Patch ID: 138469

Details

Message ID 9f62b06d0f7c0df4f3ca91b24af2c0d791d16d7c.1490573768.git.paul.eggleton@linux.intel.com
State New
Headers show

Commit Message

Paul Eggleton March 27, 2017, 12:17 a.m.
If you had a script that uses tinfoil and it failed to connect to the
BitBake server, you did't see any of the expected messages - this was
because client-side logging wasn't being handled at all. Since you'll
almost always want this when using tinfoil, have it use the new
bb.msg.logger_create() function to enable client-side logging by
default.

Relates to [YOCTO #11185].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bb/tinfoil.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py
index 19b41be..c2ee707 100644
--- a/lib/bb/tinfoil.py
+++ b/lib/bb/tinfoil.py
@@ -210,13 +210,17 @@  class TinfoilCookerAdapter:
 
 class Tinfoil:
 
-    def __init__(self, output=sys.stdout, tracking=False):
+    def __init__(self, output=sys.stdout, tracking=False, setup_logging=True):
         self.logger = logging.getLogger('BitBake')
         self.config_data = None
         self.cooker = None
         self.tracking = tracking
         self.ui_module = None
         self.server_connection = None
+        if setup_logging:
+            # This is the *client-side* logger, nothing to do with
+            # logging messages from the server
+            bb.msg.logger_create('BitBake', output)
 
     def __enter__(self):
         return self

Comments

Paul Eggleton March 27, 2017, 7:02 a.m.
On Monday, 27 March 2017 1:17:28 PM NZDT Paul Eggleton wrote:
> If you had a script that uses tinfoil and it failed to connect to the
> BitBake server, you did't see any of the expected messages - this was
> because client-side logging wasn't being handled at all. Since you'll
> almost always want this when using tinfoil, have it use the new
> bb.msg.logger_create() function to enable client-side logging by
> default.

Sigh... this causes a bunch of debug messages from the codeparser to get shown 
when using devtool add. I am still tracking that issue down - perhaps it's 
better than not seeing any messages at all though.

- Paul