Omnis Externals
LogFile Documentation
A log file utility external for use with Omnis Studio
Outline of LogFile Library v0.1
The "LogFile" external library provides users with a means to create log files, external to the Studio environment, and pass a series of log file comments to those files, with the option to automatically record date and time for each comment.
Static Methods
The library presents a set of static external methods:
- void $flush(): Clears the contents of the current LogFile and adds information indicating the time and date of this activity.
- character[]$getfile(): Returns the full path to the current LogFile.
- character[]$getlasterror(): Returns a string describing the last detected error.
- int $getlength(): Returns the current size of the LogFile (in bytes).
- character[]$getoption(): Returns a human readable string (in English) describing enabled prefixes.
- int $getoptionflags(): Returns a machine readable value describing enabled prefixes. Information is contained within the first two bits of the returned integer. If the low bit is set then time-stamping is enabled, if the high bit is set then date-stamping is enabled. E.g. a return value of 0 means that no options are enabled whilst a value of 3 indicates that both time- and date- stamping are enabled.
- void $setfile( character[] ): sets the path and filename of the log file. No return value.
- void $setoption( character[] ): accepts a string that describes information that is to be prefixed to LogFile entries. LogFile can prefix time and/or date information to entries. To enable time-stamping include the symbol 't' in the passed string. To enable date-stamping include the symbol 'd' in the passed string. To disable either of these features prefix the relevant symbol with '-'.
E.g. passing '-td' will disable time-stamping and enable date-stamping.
- character[] $versionInfo(): returns a character array containing the control string: " LogFile version: MAJOR_VERSION_NUMBER . MINOR_VERSION_NUMBER ".
- void $write( character[] ): adds an entry to the current LogFile.

|