Logger

Logger class.

new Logger()
License: https://opensource.org/licenses/MIT
Author: Patrick Heng & Fabien Motte <hengpatrick.pro@gmail.com / contact@fabienmotte.com>
Example
const logger = new Logger()
logger.log('Test')
Instance Members
on()
off()
reset()
br()
level(name, options)
plugin(name, fn, options)
setHandler(handlerFn)

namespace

Namespace plugin.

namespace(msgs: String, options: Object, level: Object): Object
Parameters
msgs (String) Messages.
options (Object = {}) Plugin options.
Name Description
options.name String (default null) Namespace name.
options.capitalize Boolean (default false) Capitalize.
options.styles Object (default {}) Plugin styles.
level (Object) Level.
Name Description
level.name String Level name.
level.options Object Level options.
Returns
Object: Plugin result.

time

Time plugin.

time(msgs: String, options: Object, level: Object): Object
Parameters
msgs (String) Messages.
options (Object) Plugins options.
level (Object) Level.
Name Description
level.name String Level name.
level.options Object Level options.
Returns
Object: Plugin result.

camelToKebab

Camel to kebab case.

camelToKebab(str: String): String
Parameters
str (String) String.
Returns
String: Parsed string.

capitalize

Capitalize.

capitalize(str: String): String
Parameters
str (String) String.
Returns
String: Capitalized string.