emoji-logger
v1.0.15
Published
Logging library based on flat colors and Emoji.
Downloads
464
Maintainers
Readme
emoji-logger
Logging library based on flat colors and Emoji.
:cloud: Installation
# Using npm
npm install --save emoji-logger
# Using yarn
yarn add emoji-logger
:clipboard: Example
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");
:question: Get Help
There are few ways to get help:
- Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
- For bug reports and feature requests, open issues. :bug:
- For direct and quick help, you can use Codementor. :rocket:
:memo: Documentation
emojiLogger(msg, type, override)
Logs the specified message.
Params
- String
msg
: The message to log. - String
type
: The message type (default:"info"
). - Object
override
: An object to override the type object fields.
log(msg, type, override)
Writes the input message having the type object.
Params
- String
msg
: The message to log. - Object
type
: The type object. - Object
override
: An object to override the type object fields.
add(type, icon, color, indent, stream, boolean)
Adds a new logging type.
Params
- String
type
: The log type as string or an object containing: - String
icon
: The emoji icon name interpreted byemojic
. - String
color
: The color name (interpreted bycolor-it
). - Number
indent
: The indent width. - Stream
stream
: The stream where the messages of this type will be written (default:process.stdout
). - displayEmoji
boolean
: Iffalse
, emojis will not be added in the message. By default, it'sfalse
on Windows systems andtrue
otherwise.
Return
- Object The type object.
:yum: How to contribute
Have an idea? Found a bug? See how to contribute.
:sparkling_heart: Support my projects
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:
:dizzy: Where is this library used?
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