filePath(path) | path: string | Sets the path in which logs will be saved, defaults to ./logFile |
setShowProgram(var) | var: boolean | Sets whether program path is included along with timestamp |
setShowClearedMessage(var) | var: boolean | Sets whether message is displayed if log is cleared |
setCurrentProgram(var) | var: string | Sets the program name that will be displayed if show program is set to true using setShowProgram(var) |
setClearedMessage(message) | message: string | Sets message that will be displayed if setShowClearedMessage(var) is set to true |
setProgramFormat(pFormat) | pFormat: string | Standard string format, defaults to [%s] where %s is name of the program |
setTimestampFormat(tFormat) | tFormat: string | Standard string format, defaults to [%s] where %s is the time according to setDateTimeFormat() |
setDateTimeFormat(dFormat) | dFormat: string | Time format for os.date() defaults to %F %R |
reset() | Reset all values to default values | |
output(statement) | statement: string | Writes a line to the log file following restrictions above |
clear() | Clears the log file, writes a message if specified |
log.setTimestampFormat("{%s}")
log.setDateTimeFormat("%R")
os.loadAPI("log.lua")
log.output("Test log sentence")
Example Output in ./logFile:[2025-15-5 18:23]: Test log sentence