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()

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/793932
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I3ff3a9738d3e5600d045742fb5828ae51a646b08
Gerrit-Change-Number: 793932
Gerrit-PatchSet: 1
Gerrit-Owner: Mpaa <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to