Ray Yates
: ray d0t yates at, pcinet d0t com
06/05/2011 07:54 a.m.
06/05/2011 07:54 a.m.
This function creates an error log file, writing a new line each time it's called. It checks to see if the file exsists before using file_append(). If not it creates it using file_create()
<MvFUNCTION
NAME
="
error_log
"
PARAMETERS
="
message
"
STANDARDOUTPUTLEVEL
=""
>
<MvASSIGN
NAME
="
l.ok
"
VALUE
="
{ Module_Description(l.module) }
>"
<MvASSIGN
NAME
="
l.file
"
VALUE
="
{ l.module:code $ '_error.log' }
>"
<MvIF
EXPR
="
{ fexists(l.file) }
>"
<MvASSIGN
NAME
="
var
"
VALUE
="
{ file_append(l.file, 'data', l.message) }
>"
<MvELSE>
<MvASSIGN
NAME
="
var
"
VALUE
="
{ file_create(l.file, 'data', l.message) }
>"
</MvIF>
</MvFUNCTION>