[ww-devel] Issuing warning messages in PG
Davor Cubranic
cubranic at stat.ubc.ca
Tue Aug 26 14:27:02 EDT 2014
The current code and documentation seem to be a bit out of date about issuing warnings. For instance, in ‘lib/PGcore.pm’, there is the following POD:
There are three message channels
$PG->debug_message() or in PG: DEBUG_MESSAGE()
$PG->warning_message() or in PG: WARNING_MESSAGE()
They behave the same way, it is simply convention as to how they are used.
But there is no macro WARNING_MESSAGE anywhere. There is, however, WARN_MESSAGE in ‘macros/PG.pl’. This one is not quite the same as just calling ‘$PG->warning_message()’, because it decorates the message with caller info and frames it with a line border.
‘lib/PGcore.pm’ also used to contain function “WARN”, but it was commented out in commit 92127e6 (in 2010). It is still used by the “custom_problem_grader_fluid” macro in ‘macro/PGgraders.pl’.
Question: what is the right thing to do? I’m seeing PG macros using mostly “WARN_MESSAGE”, with a few “warn” thrown in. Nobody calls $PG->warning_message directly.
Davor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://webwork.maa.org/pipermail/webwork-devel/attachments/20140826/bed2c825/attachment.html>
More information about the webwork-devel
mailing list