Namespace: DuDebug

DuDebug

Tools for debugging

Members

staticDuDebug.debugLogDuDebugLog null

Set this attribute to a DuDebugLog you have created to automatically add some debug infos to the log (like catched errors).

static,readonlyDuDebug.LogLevelint

The log levels
Properties:
Name Type Default Description
VERBOSE int 0
DEBUG int 1
WARNING int 2
CRITICAL int 3
FATAL int 4
NO_DEBUG int 5

Methods

staticDuDebug.checkVar(variable, argName, argType, functionName){string|bool}

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 578
Checks if the given variable has the correct type,
alerts a nice error if not using DuDebug.throwUndefinedError() or DuDebug.throwTypeError().
Name Type Description
variable any The variable to check
argName string The variable name
argType string optional The expected type name (as return by jstype()). If not provided, checks only if the var is undefined
functionName any optional The name or description of the function throwing the error.
Returns:
Type Description
string | bool The (multiline) description for the error if any and DuESF.debug is true, false if there's an error and DuESF.debug is false, true if everything is ok.

staticDuDebug.error(error)

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 415
This methods shows an alert with an error thrown if DuESF.debug is set to true, and logs it in DuESF.debug.DuDebugLog if it has been set.
Name Type Description
error Error | string An error thrown and catched

staticDuDebug.inspect(obj, ownProperties){string}

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 468
Inspects a javascript object and outputs all of its attributes
Name Type Default Description
obj object The object to inspect.
ownProperties boolean true optional Wether to inspect only the own properties of the object.
Returns:
Type Description
string The report.

staticDuDebug.log(message, level)

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 406
Logs a message to DuDebug.DuDebugLog if it has been set.
Name Type Default Description
message string The message to log
level DuDebug.LogLevel DuDebug.LogLevel.DEBUG optional The level of the message

staticDuDebug.safeRun(callback){any}

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 433
Runs a method/script safely, i.e. enclosed in a try...catch, and logs any error thrown.
arguments can be added after the first parameter, they will be passed to the callback.
The callback is enclosed in a function to make sure it does not create global variables.
Name Type Description
callback function | string The method to run, or a script as a string
Returns:
Type Description
any The return of the callback, null if it fails.

staticDuDebug.throwError(message, functionName, error){string}

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 545
Alerts a nice Error description, if DuESF.debug is true, and logs it if there's a log..
Note that it does not actually throws an error.
Name Type Description
message any The message to show
functionName any optional The name or description of the function throwing the error.
error Error optional A JS error.
Returns:
Type Description
string The (multiline) description for the error

staticDuDebug.throwTypeError(variable, varName, varType, functionName){string}

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 490
Alerts a nice TypeError description, if DuESF.debug is true, and logs it if there's a log.
Note that it does not actually throws an error.
Name Type Description
variable any The failing argument
varName string The failing argument name
varType string The expected type
functionName string optional The name or description of the function throwing the error.
Returns:
Type Description
string The (multiline) description for the error

staticDuDebug.throwUndefinedError(varName, functionName){string}

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 517
Alerts a nice UndefinedError description, if DuESF.debug is true, and logs it if there's a log..
Note that it does not actually throws an error.
Name Type Description
varName any The name of the arg which should not be undefined
functionName any optional The name or description of the function throwing the error.
Returns:
Type Description
string The (multiline) description for the error