helpers/jrdebug

Debug support module

Notes
  • Uses debug module for logging to console
Source:
Author:

Methods

(inner) cdebug(…args)

Source:

Conditional passthrough to debug module function to show some info on console. Does nothing if debug mode is off.

Parameters:
Name Type Attributes Description
args * <repeatable>
Returns:

result of debug module function

(inner) cdebugf(string, …args)

Source:

Conditional call to debug module function after formatting string using util.format Does nothing if debug mode is off.

Example
cdebugf("misc", "%s:%d", str, val);
Parameters:
Name Type Attributes Description
string string

string to pass to util.format

args * <repeatable>

arguments for util.format

Returns:

result of debug module function

(inner) cdebugObj(obj, msg)

Source:

Conditional dump an object with its properties, with an optional message Does nothing if debug mode is off.

Parameters:
Name Type Description
obj object

object to dump

msg string

message to show before dumping object (ignored if null/undefined)

(inner) debug(…args)

Source:

Passthrough to debug module function to show some info on console

Parameters:
Name Type Attributes Description
args * <repeatable>
Returns:

result of debug module function

(inner) debugf(string, …args)

Source:

Invoke to debug module function after formatting string using util.format

Example
debugf("%s:%d", str, val);
Parameters:
Name Type Attributes Description
string string

string to pass to util.format

args * <repeatable>

arguments for util.format

Returns:

result of debug module function

(inner) debugObj(obj, msg)

Source:

Dump an object with its properties, with an optional message

Parameters:
Name Type Description
obj object

object to dump

msg string

message to show before dumping object (ignored if null/undefined)

(inner) debugObj2(obj, msg)

Source:

Dump an object with its properties, with an optional message

Parameters:
Name Type Description
obj object

object to dump

msg string

message to show before dumping object (ignored if null/undefined)

(inner) getDebugTagEnabled()

Source:

Getter for the debug mode

Returns:

true if debugging is enabled for a tag

(inner) setDebugTagEnabled(debugTag, val)

Source:

Setter for debug mode on or off. This controls whether certain debug functions (those ending in 'c' for conditional) actually generate output

Parameters:
Name Type Description
debugTag string
val boolean

(inner) setup(iserviceName)

Source:

Initialize values for the debugging system to use

Parameters:
Name Type Description
iserviceName string

name of the application or process, for use in filename and console messages

(inner) setupDebugmod()

Source:

Setup the debug module logger for console messages

Returns:

the debug module created function for invoking debug statement