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. |
Members
DuDebug.LogLevel
# static enabled
true to enable the log and record logs.
- Default Value:
- DuESF.debug
Methods
# checkTimer(message, levelopt) → {int}
Checks the time elapsed since the timer has started
If the timer is not running, it will be 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 |
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 |
# 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 |
# 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 |