ErrLogEx()

Anonymous
Anonymous

Toolbox Template

Custom Message Logging to Disk

Version
1.1

Requirements
Citect 7.20 or above

Description
This Cicode function allows you to send messages to the syslog.dat like the ErrLog() function does. However, this extends the functionality by allowing other log files to be written to. It also allows you to specify the priority level of each log message. Then, set a citect.ini parameter for each log file to choose which priority levels should be logged. This allows you to turn on a certain amount of logging while testing, then turn it back off without having to restart the runtime or change any code. This includes my ParameterGetBuf() function to allow parameters to be read from memory and automatically re-read from disk once a minute so disk access is minimized.

Updates:
v1.1 10/2/2018 Fixed problem with corruption of custom logs with multiple threads. Added ErrLogExTrace parameter. Fixed creation of BAK files. Decreased number of file writes. Improved documentation of parameters.

Author
Eric Black

Submitter
Eric Black

Attachments