## 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_Duik_api.jsxinc, line 1223

# Members

Type: `DuDebug.LogLevel`

#### # static enabled

true to enable the log and record logs.

Default Value:
  - DuESF.debug

View Source DuAEF_Duik_api.jsxinc, line 1265

Type: `File`

#### # static readonly file

The log file.

View Source DuAEF_Duik_api.jsxinc, line 1237

Type: `DuDebug.LogLevel`

#### # static level

The log level.

Default Value:
  - DuDebug.LogLevel.DEBUG

View Source DuAEF_Duik_api.jsxinc, line 1256

# 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_Duik_api.jsxinc, line 1387

Returns:
The time elapsed in milliseconds
Type: `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_Duik_api.jsxinc, line 1297

#### # 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_Duik_api.jsxinc, line 1321

#### # 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_Duik_api.jsxinc, line 1351