@mvf/logger v1.0.10
MVF Logger
Usage
Provides a consistent logging output for javascript applications.
To install the package
Run npm install @mvf/logger
How to use
Import log function of your choice and then use them to output a log message.
import { info, warning, error } from "@mvf/logger";
info("info message");
warning("info message");
error("info message");The logger can also accept an object of extra data, which will be logged together with the message.
import { info } from "@mvf/logger";
info("info message", {
clickId: "...",
...
});Exceptions
Logger is configured to catch any unhandled exceptions and output them to the console in a json format, consistent with the other log messages.
Testing
Logger will be silent, it will not log anything, if ENVIRONMENT_FILE env variable is set to testing.
Formatting
Logger will format output using prettyPrint formatter if ENVIRONMENT_FILE env variable is set to development in all other cases json formatter will be used to ensure consistent log output.
Contributing
Setup
- Run
maketo build the container - Run
make shellto enter the container - Run
npm installto install dependencies
Refer to package.json for commands
After merging
After you have merged a PR to master, you need to rebuild and publish your changes.
- Checkout master
git checkout master && git pull - Use one of the following make publish commands to publish changes:
make publish kind=patch- Use this if your change is a bug fix and is backwards compatible.make publish kind=minor- Use this if your change adds new functionality and is backwards compatible.make publish kind=major- Use this if your change is not backwards compatible.
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago