Suggested addition to Errsysw.prg
Posted: Sat Jun 28, 2008 3:48 pm
Below is an addition that I made to my version of Errsysw.prg that I find very helpful. This addition retains info from any prior error.log, adding it to the end of the current cErrorlog, until the error.log file exceeds 50 K in size. If over 50 K, then just the most recent 5k chars of info are retained, and the file builds again.
This prevents losing important error info in a situation where different errors occur in quick succession before you have a chance to debug the first errors in the sequence. Especially important where a customer fails to tell you about an earlier error before they crash the app with something else.
Here it is, to be added just above existing Errsysw.prg comment,
"// Generates a file with an Error Log "
- Roger
This prevents losing important error info in a situation where different errors occur in quick succession before you have a chance to debug the first errors in the sequence. Especially important where a customer fails to tell you about an earlier error before they crash the app with something else.
Here it is, to be added just above existing Errsysw.prg comment,
"// Generates a file with an Error Log "
Code: Select all
// If an Error.log already exists, add it to bottom of cErrorLog.
// Added this to retain prior error messages up to limit of 25k...
IF FILE("Error.log")
cText := MEMOREAD("Error.log")
cText := CRLF+CRLF+REPLICATE("*",50)+ ;
CRLF+REPLICATE("*",50)+CRLF+CRLF+cText
IF LEN(cText) < 50000
cErrorLog += cText
ELSE
cErrorLog += SUBSTR(cText,1,5000)
ENDIF
ENDIF
// Generates a file with an Error Log
BEGIN SEQUENCE // [ continue with existing PRG code... ]