File LogFile.lua
Functions
LogFile:clear () | Clear contents of log file. |
LogFile:disable () | Disables the log file - no more logs will be accepted after this is called. |
LogFile:enable (t) | Enables the logger for logging. |
LogFile:getLogContents () | Get contents of log file. |
LogFile:getLogFilePath () | Get path to log file. |
LogFile:logError (num, msg) | Logs an error line with an error prefix that includes index number, and counts it. |
LogFile:logInfo (message, verbose) | Logs a message line, or end-of-line - EOL output after message. |
LogFile:logInfoStart (message, verbose) | Logs a message segment, no EOL output. |
LogFile:logWarning (num, msg) | Logs a warning line with a warning prefix that includes index number, and counts it. |
LogFile:new (t) | Constructs a not-yet-enabled logger. |
LogFile:newClass (t) | Constructor to extend class. |
Functions
- LogFile:clear ()
-
Clear contents of log file.
It does this by simply deleting it.
App clears warning & error counters when calling.
- LogFile:disable ()
-
Disables the log file - no more logs will be accepted after this is called.
Presently, this shan't be called, since a plugin either includes log file support or it doesn't. (not true @2010-11-22, but may be @some.)
User doesn't have a say. Still, just in case...
- LogFile:enable (t)
-
Enables the logger for logging.
###2 To Do: resurrect ability to route debug-trace messages to debugger instead of log file.
Parameters:
-
t
:
-
- LogFile:getLogContents ()
-
Get contents of log file.
Normally this is not required, since there is a show-log-file method in the app interface. The motivation for this function is to support a klugy send-log-file feature that involves the user copying the log contents from an edit field to the clipboard and pasting it in an email.
- LogFile:getLogFilePath ()
-
Get path to log file.
Return value:
- The path, or nil if logger not enabled for logging to file.
- LogFile:logError (num, msg)
-
Logs an error line with an error prefix that includes index number, and counts it.
Parameters:
-
num
: -
msg
:
Usage:
No-op if logger not open.
Errors are never considered verbose.
-
- LogFile:logInfo (message, verbose)
-
Logs a message line, or end-of-line - EOL output after message.
Parameters:
-
message
: -
verbose
:
Usage:
No-op if logger not open.
-
- LogFile:logInfoStart (message, verbose)
-
Logs a message segment, no EOL output.
Parameters:
-
message
: -
verbose
:
Usage:
No-op if logger not open.
-
- LogFile:logWarning (num, msg)
-
Logs a warning line with a warning prefix that includes index number, and counts it.
Parameters:
-
num
: -
msg
:
Usage:
No-op if logger not open.
Warnings are never considered verbose.
-
- LogFile:new (t)
-
Constructs a not-yet-enabled logger.
Initialization parameters:
- verbose
- overwriteParameters:
-
t
: Initialization parameter table.
-
- LogFile:newClass (t)
-
Constructor to extend class.
Parameters:
-
t
:
-