diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/tinfoil.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py index fb2ee4ad9c..fa95f6329f 100644 --- a/bitbake/lib/bb/tinfoil.py +++ b/bitbake/lib/bb/tinfoil.py | |||
@@ -322,14 +322,14 @@ class Tinfoil: | |||
322 | self.server_connection = None | 322 | self.server_connection = None |
323 | self.recipes_parsed = False | 323 | self.recipes_parsed = False |
324 | self.quiet = 0 | 324 | self.quiet = 0 |
325 | self.oldhandlers = self.logger.handlers[:] | ||
325 | if setup_logging: | 326 | if setup_logging: |
326 | # This is the *client-side* logger, nothing to do with | 327 | # This is the *client-side* logger, nothing to do with |
327 | # logging messages from the server | 328 | # logging messages from the server |
328 | oldhandlers = self.logger.handlers[:] | ||
329 | bb.msg.logger_create('BitBake', output) | 329 | bb.msg.logger_create('BitBake', output) |
330 | self.localhandlers = [] | 330 | self.localhandlers = [] |
331 | for handler in self.logger.handlers: | 331 | for handler in self.logger.handlers: |
332 | if handler not in oldhandlers: | 332 | if handler not in self.oldhandlers: |
333 | self.localhandlers.append(handler) | 333 | self.localhandlers.append(handler) |
334 | 334 | ||
335 | def __enter__(self): | 335 | def __enter__(self): |
@@ -835,6 +835,12 @@ class Tinfoil: | |||
835 | self.server_connection.terminate() | 835 | self.server_connection.terminate() |
836 | self.server_connection = None | 836 | self.server_connection = None |
837 | 837 | ||
838 | # Restore logging handlers to how it looked when we started | ||
839 | if self.oldhandlers: | ||
840 | for handler in self.logger.handlers: | ||
841 | if handler not in self.oldhandlers: | ||
842 | self.logger.handlers.remove(handler) | ||
843 | |||
838 | def _reconvert_type(self, obj, origtypename): | 844 | def _reconvert_type(self, obj, origtypename): |
839 | """ | 845 | """ |
840 | Convert an object back to the right type, in the case | 846 | Convert an object back to the right type, in the case |