ppplog
v1.1.6
Published
`ppplog` is a simple logging library that provides a convenient way to control your log output.
Downloads
6
Readme
ppplog
ppplog
is a simple logging library that provides a convenient way to control your log output.
Installation
Install ppplog
using npm or yarn:
npm install ppplog
# or
yarn add ppplog
Usage
First, import ppplog
:
const ppplog = require('ppplog');
Then, you can use the ppplog
function to output logs:
let a = { a: 2 };
let b = [1, 2, 3, 4, 5, 6];
let c = 4;
ppplog(a, b, c);
You can also use chain calls:
ppplog(a)(b)(c)();
Control Log Output
You can use the disableppplog
and enableppplog
functions to disable and enable log output:
ppplog.disableppplog(); // Disable log output
ppplog(a); // This line will not output
ppplog.enableppplog(); // Enable log output
ppplog(a); // This line will output
Control Time Display
You can use the enableTime
and disableTime
functions to control whether to display the current time in the log output:
ppplog.enableTime(); // Enable time display
ppplog(a); // This line will prepend the current time to the output
ppplog.disableTime(); // Disable time display
ppplog(a); // This line will not prepend the current time to the output
Testing
You can run the following command to run tests:
npm test