summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2020-03-09 11:33:42 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-12 23:01:54 +0000
commit5ff962dca71f4ef16a3aa11b41a23f2227fe8c21 (patch)
tree1fc1b06da9947038e9d6f489d07a421f9bf9185f
parent41bd155faf7f65cb0727fcce972715769b26ca89 (diff)
downloadbitbake-5ff962dca71f4ef16a3aa11b41a23f2227fe8c21.tar.gz
lib/bb/msg: 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@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/msg.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/bb/msg.py b/lib/bb/msg.py
index ea6a9543f..c70fd8080 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