Page MenuHomePhabricator

writeToCommandLogFile() should be optional
Open, LowPublic

Description

Having configured pywikibot with python logging module there is little need for this feature.
This feature insists on checking pywikibot version which may cause problems like inability to locate git or lack of SSL certificate for tools.wmflabs.org T98104: Strict SSL certificate checking.

It should be optional (config entry?)

Details

Event Timeline

saper raised the priority of this task from to Low.
saper updated the task description. (Show Details)
saper added a project: Pywikibot-General.
saper subscribed.
Restricted Application added subscribers: Aklapper, Unknown Object (MLST). · View Herald TranscriptMay 5 2015, 1:12 AM

Yes, we could make it optional based on config variable log_pywiki_repo_version , which defaults to False in core.

Isn't log_pywiki_repo_version used only once, to log the version during logging initialization but is not respected
by writeToCommandLogFile() (both in core and compat)

What about adding command value to the config.log and making the default:

log = ['interwiki', 'command']

and then adding something like

if `command` in config.log:
    writeToCommandLogFile()

to bot.py/wikipedia.py

writeToCommandLogFile in core is very new port from compat, and it should have respected log_pywiki_repo_version.

Isn't log_pywiki_repo_version used only once, to log the version during logging initialization but is not respected
by writeToCommandLogFile() (both in core and compat)

What about adding command value to the config.log and making the default:

log = ['interwiki', 'command']

and then adding something like

if `command` in config.log:
    writeToCommandLogFile()

to bot.py/wikipedia.py

This also sounds like a good approach to me.

Change 264218 had a related patch set uploaded (by AndyTechGuy):
writeToCommandLogFile() should be optional

https://gerrit.wikimedia.org/r/264218

It looks like this has already been fixed in bot.py. It is now optional via the -nolog file.

This was not working before but will be fixed under T328900.

Aklapper added a subscriber: Enag2000.

@Enag2000 Removing task assignee as this open task has been assigned for more than two years - See the email sent to task assignee on 2025-11-25.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome! :)
If this task has been resolved in the meantime, or should not be worked on by anybody ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!

Change #264218 abandoned by JJMC89:

[pywikibot/core@master] writeToCommandLogFile() should be optional

Reason:

stale patch that cannot be merged - feel free to unabandon if you will update it

https://gerrit.wikimedia.org/r/264218