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()
<MvFUNCTIONNAME="error_log"PARAMETERS="message"STANDARDOUTPUTLEVEL=""><MvASSIGNNAME="l.ok"VALUE="{ Module_Description(l.module) }>"<MvASSIGNNAME="l.file"VALUE="{ l.module:code $ '_error.log' }>"<MvIFEXPR="{ fexists(l.file) }>"<MvASSIGNNAME="var"VALUE="{ file_append(l.file, 'data', l.message) }>"<MvELSE><MvASSIGNNAME="var"VALUE="{ file_create(l.file, 'data', l.message) }>"</MvIF></MvFUNCTION>