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 DuAEF_DuSan_api.jsxinc, line 1220

Members

DuDebug.LogLevel

# static enabled

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

View Source DuAEF_DuSan_api.jsxinc, line 1262

File

# static readonly file

The log file.

View Source DuAEF_DuSan_api.jsxinc, line 1234

DuDebug.LogLevel

# static level

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

View Source DuAEF_DuSan_api.jsxinc, line 1253

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 DuAEF_DuSan_api.jsxinc, line 1384

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 DuAEF_DuSan_api.jsxinc, line 1294

# 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 DuAEF_DuSan_api.jsxinc, line 1318

# 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 DuAEF_DuSan_api.jsxinc, line 1348