Kryzeth Standard Library

StdLib.Misc.Logger

supers: StdLib.Core

For logging debug information to files.

@usage

Methods3

function Logger.__call(self: any, ...: any) -> nil
function Logger.get(...) -> StdLib.Misc.Log

Get a saved log or create a new one if there is no saved log.

function Logger.new(log_name: nil | string, debug_mode: nil | boolean, options: StdLib.Misc.Log.options[opt]) -> StdLib.Misc.Log

Creates a new logger object. In debug mode, the logger writes to file immediately, otherwise the logger buffers the lines. <p>The logger flushes the logged messages every 60 seconds since the last message. <p>A table of @{options} may be specified when creating a logger. @usage Log = Logger.new() Log("this msg will be logged in /script-output/YourModName/log.log!") -- Immediately Write everything buffered in the log file Log()

@usage Log = Logger.new('test', true) Log("this msg will be logged and written immediately in /script-output/YourModName/test.log!")

@usage Log = Logger.new('coolmodname', 'test', true, { file_extension = data }) Log("this msg will be logged and written immediately in /script-output/YourModName/test.data!")

Parameters
log_namenil | string

[opt='log'] the name of the logger

debug_modenil | boolean

[opt=false] toggles the debug state of logger

optionsStdLib.Misc.Log.options[opt]
Returns
StdLib.Misc.Log

the logger instance

Fields3

Logger.__class: string = "Logger"
Logger._loggers: table
Logger.__index : unknown