Class

DuDebugLog

DuDebugLog(pathOrFileopt, clearopt, logLevelopt, enabledopt)

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

# new DuDebugLog(pathOrFileopt, clearopt, logLevelopt, enabledopt)

Constructs a new debug logger
Parameters:
Name Type Attributes Default Description
pathOrFile string | File <optional>
The log file. By default, located next to the script settings file (if constructed after DuESF.init()).
clear boolean <optional>
true Whether to clear the previous log file before starting
logLevel DuDebug.LogLevel <optional>
DuDebug.LogLevel.DEBUG The log level.
enabled boolean <optional>
DuESF.debug true to enable the log and start recording
Properties:
Name Type Description
running boolean true if the timer is running, false if it is stopped.

View Source DuESF.jsxinc, line 1225

Members

DuDebug.LogLevel

# static enabled

true to enable the log and record logs.
Default Value:
  • DuESF.debug

View Source DuESF.jsxinc, line 1267

File

# static readonly file

The log file.

View Source DuESF.jsxinc, line 1239

DuDebug.LogLevel

# static level

The log level.
Default Value:
  • DuDebug.LogLevel.DEBUG

View Source DuESF.jsxinc, line 1258

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 DuDebug.LogLevel <optional>
DuDebug.LogLevel.DEBUG The level of the message

View Source DuESF.jsxinc, line 1389

The time elapsed in milliseconds
int

# log(message, levelopt)

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

View Source DuESF.jsxinc, line 1299

# startTimer(messageopt, levelopt)

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

View Source DuESF.jsxinc, line 1323

# stopTimer(messageopt, levelopt)

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

View Source DuESF.jsxinc, line 1353