Hi all,
how to customize the logging output of a bot based on pywikibot? There should be a class bot.LoggingFormatter - see https://doc.wikimedia.org/pywikibot/stable/api_ref/bot.html#bot.LoggingForma... - but i don't understand how to implement it, and there seems no example code available. The pywikibot.logging module just tells how to issue log messages, but not how to configure the logger. Additionally, there's a tools._logging moduile with some cryptic docs ("Initialize the formatter with specified format strings. Initialize the formatter either with the specified format string, or a default as described above." Above????) - see https://doc.wikimedia.org/pywikibot/master/api_ref/tools/pywikibot.tools.htm... .
Thanks for any input...
Florian
Hi,
Check how the LoggingFormatter is used in function init_handlers: https://doc.wikimedia.org/pywikibot/stable/_modules/pywikibot/bot.html
HTH, Strainu
În mie., 28 aug. 2024 la 19:26, tohuuu th@tohuuu.de a scris:
Hi all,
how to customize the logging output of a bot based on pywikibot? There should be a class bot.LoggingFormatter - see https://doc.wikimedia.org/pywikibot/stable/api_ref/bot.html#bot.LoggingForma...
- but i don't understand how to implement it, and there seems no example
code available. The pywikibot.logging module just tells how to issue log messages, but not how to configure the logger. Additionally, there's a tools._logging moduile with some cryptic docs ("Initialize the formatter with specified format strings. Initialize the formatter either with the specified format string, or a default as described above." Above????) - see https://doc.wikimedia.org/pywikibot/master/api_ref/tools/pywikibot.tools.htm... .
Thanks for any input...
Florian
pywikibot mailing list -- pywikibot@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/me... To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org