Console debugger for optionally logging step by step progress.
Can be used with a {debug: true} in the instantiating call, or by URL parameter.
Setup: const debug = new Debug({debug: false, control: 'Game'});
- Source:
Methods
(inner) config() → {Object}
Setup for all the URL vs. File based debugging options
- Source:
Returns:
{ all: Boolean, url: Boolean, local: Boolean }
- Type
- Object
(inner) constructor(options)
initializing Debug constructor
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Object | { debug, control, param, urlMode, fileMode, debugAll, concatenator } See this.setOptions() for options{} properties and description. |
- Source:
(inner) debug() → {function}
console.debug output
- Source:
Returns:
Returns this.logFactory with the type
- Type
- function
(inner) error() → {function}
console.error output
- Source:
Returns:
Returns this.logFactory with the type
- Type
- function
(inner) find(findDebugs, param) → {Boolean}
Search all cases of dexter:debug in the search params and match them
with the control name.
Parameters:
| Name | Type | Description |
|---|---|---|
findDebugs |
Array | List of debug params |
param |
String | Control name to search for |
- Source:
Returns:
True or False if it's matched the param
- Type
- Boolean
(inner) info() → {function}
console.info output
- Source:
Returns:
Returns this.logFactory with the type
- Type
- function
(inner) log() → {function}
console.log output
- Source:
Returns:
Returns this.logFactory with the type
- Type
- function
(inner) logFactory(logType) → {function|null}
Take a type and console out that type to this.printIt()
Parameters:
| Name | Type | Description |
|---|---|---|
logType |
String | log, warn, error, info, table, debug |
...log |
Array | Implicit arguments cast from the logger functions |
- Source:
Returns:
Returns this.printIt
- Type
- function | null
(inner) printIt(type, log) → {function}
Prints the output to the console via the methods chosen
Parameters:
| Name | Type | Description |
|---|---|---|
type |
String | Type of logger to use |
log |
String | Array | Object | Accepts any number of arguments of any type. |
- Source:
Returns:
Executes console.log, etc. via .apply() with the options chosen
- Type
- function
(inner) setOptions(options) → {Object}
Setup for all the debugging options
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Object | { debug: Boolean, control: String, param: String, urlMode: String, fileMode: String, debugAll: String, concatenator: String } |
- Source:
Returns:
The options object with instantiated overrides, or the defaults.
- Type
- Object
(inner) sort(scenario) → {Object}
Parse all options and return the proper scenario for debugging
Parameters:
| Name | Type | Description |
|---|---|---|
scenario |
Object | { all, url, local } from this.config() |
- Source:
Returns:
{ mode: Boolean, type: Boolean }
- Type
- Object
(inner) table() → {function}
console.table output
- Source:
Returns:
Returns this.logFactory with the type
- Type
- function
(inner) trace(log) → {function}
console.trace output
Parameters:
| Name | Type | Description |
|---|---|---|
log |
Array | Object | Accepts any number of arguments of any type. |
- Source:
Returns:
Returns this.logFactory with the type
- Type
- function
(inner) warn() → {function}
console.warn output
- Source:
Returns:
Returns this.logFactory with the type
- Type
- function