miva_writelog()

 
Writes a message to the log with the specified priority. Will return failure unless the miva log is open.
Syntax
miva_writelog( priority, message )
Returns 1 on success, 0 on error
  • priority = a string containing a list of words. These words may be either a facility code (see miva_openlog) or a priority code (see miva_setlogmask). Commas and/or spaces separate the words. The facility may be omitted in which case the default will be assumed (see miva_openlog). If the priority is omitted or has been disabled via a call to miva_setlogmask, then the miva_writelog call will be ignored.
  • message = a string that will be written to the log.
User Annotations: miva_writelog
Jonathan Burchmore : jburchmore at, mivamerchant d0t com
04/03/2013 15:37 p.m.
Here is a simple example that demonstrates logging.
<MvIF EXPR = "{ NOT miva_openlog( 'Logging example', '', 'USER' ) }">
    miva_openlog failed
    <MvEXIT>
</MvIF>

<MvIF EXPR = "{ NOT miva_writelog( 'INFO', 'This is an INFO message' ) }">
    miva_writelog failed
    <MvEXIT>
</MvIF>

<MvIF EXPR = "{ NOT miva_writelog( 'DEBUG', 'This is a DEBUG message' ) }">
    miva_writelog failed
    <MvEXIT>
</MvIF>

<MvIF EXPR = "{ NOT miva_closelog() }">
    miva_closelog failed
    <MvEXIT>
</MvIF>