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