Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.03 KB

README.md

File metadata and controls

54 lines (36 loc) · 1.03 KB

better-cl

Setup

Install

npm install better-cl

Usage

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.