Page MenuHomePhabricator

make logging interface consistent
Closed, ResolvedPublic

Description

bot.debug has a different interface from all other logging functions:

def debug(text, layer, decoder=None, newline=True, **kwargs):

versus

def error(text, decoder=None, newline=True, **kwargs):

We should deprecate layer, for _logger, passed as kwarg (in debug) or the other way around (for all other functions).

Event Timeline

valhallasw raised the priority of this task from to Needs Triage.
valhallasw updated the task description. (Show Details)
valhallasw added a project: Pywikibot.
valhallasw subscribed.

ha! I actually had included exactly this (deprecating 'layer') in my warnings patch, but didnt submit it for https://gerrit.wikimedia.org/r/#/c/187106/ , and partly because I suspected that adding layer to all of them would be a better approach.

Change 630209 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [IMPR] make logging interface consistent

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

Change 649823 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [cleanup] Show a FutureWarning for output stdout parameter

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

Change 649823 merged by jenkins-bot:
[pywikibot/core@master] [cleanup] Show a FutureWarning for output stdout parameter

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

Change 783860 merged by jenkins-bot:

[pywikibot/core@master] [IMPR] make debug layer optional

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

Change 630209 merged by Xqt:

[pywikibot/core@master] [IMPR] make logging interface consistent

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

Xqt claimed this task.