jenkins-bot submitted this change.
[IMPR] remove color tags from log records
Bug: T302804
Change-Id: I3ff3a9738d3e5600d045742fb5828ae51a646b08
---
M pywikibot/tools/_logging.py
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/pywikibot/tools/_logging.py b/pywikibot/tools/_logging.py
index 682f3e2..f16cf89 100644
--- a/pywikibot/tools/_logging.py
+++ b/pywikibot/tools/_logging.py
@@ -6,6 +6,8 @@
#
import logging
+from pywikibot.userinterfaces.terminal_interface_base import new_colorTagR
+
class LoggingFormatter(logging.Formatter):
@@ -27,4 +29,8 @@
record.args = (msg,)
+ # remove color tags
+ if record.msg:
+ record.msg = new_colorTagR.sub('', record.msg)
+
return super().format(record).rstrip()
To view, visit change 793932. To unsubscribe, or for help writing mail filters, visit settings.