Requires
Members
(static) debugEnabled
Status of debugging, exported to allow modules to pre-fill their own test values
(static) enabled
Status of logger, determines if console wrapper functions are executed
Methods
(static) beginFunction(functionName, argsopt) → {undefined}
Shortcut to start a group with the name of a function and its arguments
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
functionName |
String |
Name of the function, to serve as the group caption |
|
args |
Array.<Any> |
<optional> |
The function's arguments object |
(static) deep(obj)
Log an object to the console as a deep copy
Parameters:
Name | Type | Description |
---|---|---|
obj |
any |
(static) enable()
Enables logging
(static) endResult(res)
Shortcut for LOG.log({result: res});LOG.groupEnd()
Parameters:
Name | Type | Description |
---|---|---|
res |
Any |
result of function |
(static) error(msg, title) → {undefined}
Wrapper for console.error, dependent on whether logging has been enabled
Parameters:
Name | Type | Description |
---|---|---|
msg |
String |
Error message to log to console |
title |
String |
Title for error message |
(static) exitFunction(resopt) → {undefined}
Use when exiting a function due to missing or invalid input(s)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
res |
Any |
<optional> |
Result of the function |
(static) group(msg) → {undefined}
Wrapper for console.group, dependent on whether logging has been enabled
Parameters:
Name | Type | Description |
---|---|---|
msg |
String |
Message to log to console |
(static) groupCollapsed(msg) → {undefined}
Wrapper for console.groupCollapsed, dependent on whether logging has been enabled
Parameters:
Name | Type | Description |
---|---|---|
msg |
String |
Message to log to console |
(static) groupEnd() → {undefined}
Wrapper for console.groupEnd, dependent on whether logging has been enabled
(static) log(msg, title) → {undefined}
Wrapper for console.log, dependent on whether logging has been enabled.
Parameters:
Name | Type | Description |
---|---|---|
msg |
String | Object | Array |
Message to log to console |
title |
String |
Title for message |
(static) logArgs(msg) → {undefined}
Wrapper for console.log when using multiple arguments or colors Used when behavior of the log() function is not desired.
Parameters:
Name | Type | Description |
---|---|---|
msg |
(static) presetValues()
Enables debugger
(static) warn(msg, title) → {undefined}
Wrapper for console.warn, dependent on whether logging has been enabled
Parameters:
Name | Type | Description |
---|---|---|
msg |
String |
Warning message to log to console |
title |
String |
Title for warning message |
(inner) printArray(arr) → {String}
Takes an array of [label, value] arrays and converts to text/html with breaks after each line, padded with nonbreaking spaces so values will be aligned. Labels with an empty string as their value will not be included.
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array.<Array.<String>> |
Array of any length, each member must be an array of 2 strings |