Returns the byte length of an utf8 string or an object (when parsed to JSON)
Parameters
obj
Publicly export the chalk color library
Replace all (/.../g) leading slash (^/) or (|) trailing slash (/$) with an empty string.
Parameters
urlString URL / Path to cleanup
Returns String
Clears (empties) the log object
Colors the messages by searching for specific indicator strings TODO: Allow to add to the colorMap
Parameters
msgstring
Returns string
Prints out debugging information for the current model object
Parameters
objobject Objectsilent
Prints errors
Parameters
objobject Objectsilent
Gets the current config
Returns an array with date / time information Starts with year at index 0 up to index 6 for milliseconds
Parameters
date[Date] Optional date object. If falsy, will take current time.
Returns Array
Returns the global.moboLogObject
Returns Array
Returns nicely formatted date-time
Parameters
date[object]
Examples
2015-02-10 16:01:12Returns string
Returns nicely formatted date-time
Parameters
date[object]
Examples
16:01:12Returns string
Custom Logging function
Writes Logs to console, stringifies objects first
Parameters
msgstring or object Message String or Objectobjsilent[boolean] Dot not print message to the console, but stores it to the log history.
Pad a number with n digits
Parameters
numbernumber number to paddigitsnumber number of total digits
Returns string
Parameters
bytessi
Returns string
Adds dots as thousand separators to numbers
http://stackoverflow.com/a/2901298
Parameters
number
Returns string
Returns a formatted date-time, optimized for machines
Parameters
date[object]
Examples
2015-02-10_16-00-08Returns string
Returns a formatted date-time, optimized for machines
Parameters
date[object]
Examples
2015-02-10_16-00-08Returns string
Strips trailing slashes from URL
Parameters
urlString URL to cleanup
Returns String
Updates the config. Only those parameters that have been given will be updated
Parameters
configobject
semlog A semantic logger that colors and formats messages automatically according to the content