Page MenuHomePhabricator

mw.log() and mw.logObject() fail to log anything in the console when the module returns an error
Open, Needs TriagePublicBUG REPORT

Description

Per @Becasita on Discord:

mw.log('does not print')
local a = ({})[1][1]
mw.log('does print')
local a = ({ [1] = {} })[1][1]

mw.log actually collects the values passed to it. It doesn't print them. Some other function will print the accumulated values. If the module throws, that function is never called. Shouldn't be like this; doesn't make sense to design something like this. So yeah, feels like a shortcoming.

Event Timeline

Dinoguy1000 renamed this task from mw.log() fails to log anything in the console when the module returns an error to mw.log() and mw.logObject() fail to log anything in the console when the module returns an error.Nov 4 2023, 3:18 AM

Change #1270603 had a related patch set uploaded (by Brian Wolff; author: Brian Wolff):

[mediawiki/extensions/Scribunto@master] Show lua logs in console even if error happens

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

Change #1270603 merged by jenkins-bot:

[mediawiki/extensions/Scribunto@master] Show lua logs in console even if error happens

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