Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/842493 )

Change subject: [doc] Explain bot.handler_namer function
......................................................................

[doc] Explain bot.handler_namer function

Change-Id: I27ba557b1da794eb01d47a57e42b05bf03d8f407
---
M pywikibot/bot.py
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  jenkins-bot: Verified
  Xqt: Looks good to me, approved



diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 87d057a..d85f473 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -306,6 +306,14 @@
 def handler_namer(name: str) -> str:
     """Modify the filename of a log file when rotating.

+    RotatingFileHandler will save old log files by appending the
+    extensions ``.1``, ``.2`` etc., to the filename. To keep the
+    original extension, which is usually ``.log``, this function
+    swaps the appended counter with the log extension:
+
+    >>> handler_namer('add_text.log.1')
+    'add_text.1.log'
+
     .. versionadded:: 6.5
     """
     path, qualifier = name.rsplit('.', 1)

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/842493
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: I27ba557b1da794eb01d47a57e42b05bf03d8f407
Gerrit-Change-Number: 842493
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[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