sir-logalot
v1.0.1
Published
A dead simple, declarative logging library to spice up your development life.
Downloads
3
Readme
sir-logalot
A dead simple, declarative Node.js logging library to spice up your development life.
Usage
npm install sir-logalot
const log = require('sir-logalot');
API
log.label(string, variable)
Prints an arrow between label and value of variable.
const friend = 'fred';
log.label('friend', friend); // prints: friend --> fred
log.divider()
Prints a string of stars to delineate breakpoints between logs.
for (let i = 0; i < 2; i += 1) {
console.log('in outer loop');
log.divider();
for (let j = 0; j < 2; j += 1) {
console.log('in inner loop');
}
log.divider();
}
/* prints:
in outer loop
⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️
in inner loop
in inner loop
⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️
in outer loop
⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️
in inner loop
in inner loop
⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️
*/
Symbols:
You may optionally provide a string as an argument to overwrite the default messages.
log.error([msg])
log.success([msg])
log.warning([msg])
log.info([msg])
ASCII Art:
You may optionally provide a string as an argument to overwrite the default messages.
log.frog([msg])
log.cat([msg])
log.cow([msg])
Emojis:
log.emoji(key)
log.emoji('hamburger'); // prints: 🍔
For a full list of emoji key-value pairs, check out https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json