$ npm install emoji-logger
Logging library based on flat colors and Emoji.
# Using npm
npm install --save emoji-logger
# Using yarn
yarn add emoji-logger
const log = require("emoji-logger");
// Info message
log("The default type is info.");
log("Show another info message", "info");
log("A success message.", "success");
log("Some nasty error", "error");
log("Warning! Do not touch!", "warn");
// Add a new type
log.add("fail", "disappointed", "pomegranateBg", 1);
// Show the fail message
log("Something went wrong.", "fail");
There are few ways to get help:
emojiLogger(msg, type, override)
Logs the specified message.
msg
: The message to log.type
: The message type (default: "info"
).override
: An object to override the type object fields.log(msg, type, override)
Writes the input message having the type object.
msg
: The message to log.type
: The type object.override
: An object to override the type object fields.add(type, icon, color, indent, stream, boolean)
Adds a new logging type.
type
: The log type as string or an object containing:icon
: The emoji icon name interpreted by emojic
.color
: The color name (interpreted by color-it
).indent
: The indent width.stream
: The stream where the messages of this type will be written (default: process.stdout
).boolean
: If false
, emojis will not be added in the message. By default, it's false
on Windows systems and true
otherwise.Have an idea? Found a bug? See how to contribute.
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
Starring and sharing the projects you like :rocket:
—I love books! I will remember you after years if you buy me one. :grin: :book:
—You can make one-time donations via PayPal. I'll probably buy a coffee tea. :tea:
—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
Bitcoin—You can send me bitcoins at this address (or scanning the code below): 1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
Thanks! :heart:
If you are using this library in one of your projects, add it in this list. :sparkles:
packy
gh-notifier
emspect
github-emojify
pull-from-source
namly
rucksack.js
tester-init
bloggify-tools
emojer-cli
tester
© 2010 - cnpmjs.org x YWFE | Home | YWFE