|
SYNOPSIS
<PUTMSG call|log|print|all|override on|off>
DESCRIPTION The PUTMSG directive sets the disposition of error messages.
When a script generates errors, they are logged to vortex.log
and printed out by default. If a <putmsg> function is defined,
then logging and printing are turned off, and the function is called
instead (see p. for details).
By setting the appropriate action (call, log,
print, or all for all three) in a <PUTMSG>
directive, a different set of call/log/print actions can be set for
the script as desired. A typical use for this is to turn logging and
printing back on when a <putmsg> function is defined, so that
errors can be monitored on-the-fly by the script itself, but are still
logged for later perusal, without having to log them ``by hand'' in
the <putmsg> function.
As it is a directive, PUTMSG must appear before the first
function in the script, and sets the error message actions for the
entire script. The <vxcp> function (p. ) can
be called to override these settings at run-time, via its
putmsg setting.
The override action has no equivalent in <vxcp putmsg>.
It makes any other <PUTMSG> directives override
<vxcp putmsg>, instead of the other way around. The reason for
this potentially confusing setting is for debugging: a script with a
complex set of <vxcp putmsg> calls can have them all
temporarily disabled by adding <PUTMSG override on> and
<PUTMSG log on> at the top temporarily, without having to edit
the rest of the script.
EXAMPLE
<PUTMSG log on>
<A NAME=putmsg PRIVATE>
<$GotErr = y>
</A>
<A NAME=main>
<EXEC /some/program></EXEC>
<IF $GotErr eq "y">
<B>An error occurred: check the logs</B>
</IF>
</A>
In this script, an error from the <EXEC> is still logged, as
well as being detected by the script via <putmsg>.
CAVEATS The PUTMSG directive was added in version 3.0.947100000 20000105.
SEE ALSO
vxcp, Error Messages section (p. ),
ErrorScript, ErrorFile settings in texis.cnf
(p. )
Copyright © Thunderstone Software Last updated: Wed Aug 6 11:57:09 EDT 2008
|