2.1.1 • Published 3 years ago
better-cl v2.1.1
better-cl
Setup
Install
npm install better-clUsage
Bare minimum
require("better-cl").setup();With options
require('better-cl').setup(console, methods, path, showTimestamp, showLabel);console the console object to override. The standard console object is the default.
levels is an array of additional methods to add to the console object. The default methods are log, warn, error, info, debug and success. The default is [].
path is the location of the logs folder. if undefined, no logs will be saved. The default is undefined.
showTimestamp is a boolean, if true, the timestamp will be shown. The default is true.
showLabel is a boolean, if true, the label will be shown. The default is true.
Example
Code
require("better-cl").setup(console, [
{
name:"simple",
value: 1,
color: "red"
}
], "logs");
console.simple("A simple example.");Output
[hh:mm:ss.ddd] [SIMPLE] A simple example.