DebugLog(pathOrFile, clearopt, logLevelopt, enabledopt)

A logger for debugging purposes: writes debug messages to a file, with date and type

new DebugLog(pathOrFile, clearopt, logLevelopt, enabledopt)

Constructs a new debug logger
Parameters:
Name Type Attributes Default Description
pathOrFile string | File The log file.
clear boolean <optional>
true Whether to clear the previous log file before starting
logLevel DuAEF.Debug.LogLevel <optional>
DuAEF.Debug.LogLevel.DEBUG The log level.
enabled boolean <optional>
DuAEF.debug true to enable the log and start recording
Properties:
Name Type Description
level DuAEF.Debug.LogLevel The log level.
file File The log file.
running boolean true if the timer is running, false if it is stopped.

Methods

checkTimer(message, levelopt) → {int}

Checks the time elapsed since the timer has started
If the timer is not running, it will be started.
Parameters:
Name Type Attributes Default Description
message string A message to display in the log
level DuAEF.Debug.LogLevel <optional>
DuAEF.Debug.LogLevel.DEBUG The level of the message
Returns:
int - The time elapsed in milliseconds

log(message, levelopt)

Logs a message
Parameters:
Name Type Attributes Default Description
message string The message to log
level DuAEF.Debug.LogLevel <optional>
DuAEF.Debug.LogLevel.DEBUG The level of the message

startTimer(messageopt, levelopt)

Starts the debugger timer.
Parameters:
Name Type Attributes Default Description
message string <optional>
A message to display in the log
level DuAEF.Debug.LogLevel <optional>
DuAEF.Debug.LogLevel.VERBOSE The level of the message

stopTimer(messageopt, levelopt)

Stops the debugger timer.
Parameters:
Name Type Attributes Default Description
message string <optional>
A message to display in the log
level DuAEF.Debug.LogLevel <optional>
DuAEF.Debug.LogLevel.DEBUG The level of the message