$d

Common log and parse functions
Source:
Version:
  • 1.0
Author:

Methods

(static) Date() → {object}

Source:
Gets the a format function
Returns:
The TimeStamp function
Type
object

(static) FormatMiliseconds(duration)

Source:
Formats miliseconds to HH:MM:SS.mm
Parameters:
Name Type Description
duration number The miliseconds

(static) Log(text)

Source:
Logs a string or object
Parameters:
Name Type Description
text string | object The string or object to print

(static) LogError(text, erroropt)

Source:
Logs an error with a description and the error object
Parameters:
Name Type Attributes Description
text string | object The string or object description
error object <optional>
Error object

(static) LogObject(object)

Source:
Logs an object
Parameters:
Name Type Description
object object The object to log

(static) LogWarning(text)

Source:
Logs a warning with a string or object
Parameters:
Name Type Description
text string | object The string or object to print

(static) SetDrawer(customDrawer)

Source:
Sets an external drawer function to export the logs
Parameters:
Name Type Description
customDrawer function The external function

(static) Stats()

Source:
Prints the current stats of the Logs such as Log, Warning and Error counts

(static) ValidateInput(params, types, optionalTypes) → {bool}

Source:
Validates the input of a functionAn array object can be checked with array[type]
Examples
function test(value){  return $d.ValidateInput(arguments, ["boolean"]);}//Returns truetest(true);//Returns false and Error Logtest("A");
function test(name, obj, vars, duration){  return $d.ValidateInput(arguments, ["string","object","array[string]"],["number"]);}//Returns truetest("Test", {obj: 1}, ["Test1","Test2"]);//Returns truetest("Test", {obj: 1}, ["Test1","Test2"], 1);//Returns false and Error Logtest("Test", {obj: 1}, [1,2], 1);
Parameters:
Name Type Description
params Array.<object> The function received params
types Array.<string> The expected type of params
optionalTypes Array.<string> The optional type of params
Returns:
If the input is valid returns true, otherwise returns false
Type
bool