jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/793932 )
Change subject: [IMPR] remove color tags from log records ......................................................................
[IMPR] remove color tags from log records
Bug: T302804 Change-Id: I3ff3a9738d3e5600d045742fb5828ae51a646b08 --- M pywikibot/tools/_logging.py 1 file changed, 6 insertions(+), 0 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
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()
pywikibot-commits@lists.wikimedia.org