This patch adds method for unsetting Formatter from display_handler in
LoggingCtl.
It will be used in list_pools implementation where formatted logging
output is not desirable.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Common/Logs.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lnst/Common/Logs.py b/lnst/Common/Logs.py
index 80bedf3..59a9a7f 100644
--- a/lnst/Common/Logs.py
+++ b/lnst/Common/Logs.py
@@ -138,6 +138,9 @@ class LoggingCtl:
logger.setLevel(logging.NOTSET)
logger.addHandler(self.display_handler)
+ def unset_formatter(self):
+ self.display_handler.setFormatter(None)
+
def set_recipe(self, recipe_path, clean=True, expand=""):
recipe_name = os.path.splitext(os.path.split(recipe_path)[1])[0]
if expand != "":
--
2.4.11