[oe-commits] [bitbake] 04/15: bitbake: lib/bb/msg.py: Add repr for BBLogFormatter

git at git.openembedded.org git at git.openembedded.org
Wed Mar 11 14:44:07 UTC 2020


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 6cdf80c289622db9f9fbb68890d4a8a0ce0aa386
Author: Joshua Watt <JPEWhacker at gmail.com>
AuthorDate: Mon Mar 9 11:33:42 2020 -0500

    bitbake: lib/bb/msg.py: Add repr for BBLogFormatter
    
    Adds a __repr__ function for BBLogFormatter. This allows it to get a
    human readable string when printed using the logging_tree module
    
    Signed-off-by: Joshua Watt <JPEWhacker at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/msg.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/bb/msg.py b/lib/bb/msg.py
index ea6a954..c70fd80 100644
--- a/lib/bb/msg.py
+++ b/lib/bb/msg.py
@@ -98,6 +98,9 @@ class BBLogFormatter(logging.Formatter):
     def enable_color(self):
         self.color_enabled = True
 
+    def __repr__(self):
+        return "%s fmt='%s' color=%s" % (self.__class__.__name__, self._fmt, "True" if self.color_enabled else "False")
+
 class BBLogFilter(object):
     def __init__(self, handler, level, debug_domains):
         self.stdlevel = level

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list