Open the specified file for logging. The file is opened in append mode if it already exists, or is created if it doesn't.
If the log is opened using the first form of this command, all lines written to the log will be forcefully flushed to the file before the command returns - this can cause a noticable impact on the speed of your code.
The second form of this command allows you to disable the flushing of data into the file. Set the Autoflush flag to zero if flushing is not required, or set it to one to cause flushing to occur.
In the event of an error resulting in a standard DBPro error message, your data will be cleanly flushed to disk. If your program fails in another way (eg a bug in the runtime causes a program crash) then there is no guarantee that your data will be written to the log file unless flushing is enabled.
If messages are written but the log file is not open, the messages will be ignored, and will not cause an error. This allows you to activate or deactivate logging simply by opening and closing the log. |