- Pretty - Human readable logs that are easy on the eyes
- JSON - Machine readable logs that are compatible with the Bunyan CLI
- Standard - Human readable stdout logs
- Common - Logs that adhere to the Common Log Format
- Everything is customizable and configurable import adze from 'adze';
// Generating a log
adze.timestamp.ns('foo').log('A log with a timestamp and namespace.');
// Making a child logger
const logger = adze.timestamp.ns('foo').seal();
logger.log('A log with a timestamp and namespace.');
Adze 2.x comes with support for four different types of log formats out-of-the-box. These formats include: import adze, { setup } from 'adze';
setup({
format: 'json', // <- Change with an env var
});
adze.withEmoji.success('This is a pretty log!');
Adze 2.x also includes a handy new template literal logging feature for times where you are repeating logs frequently with slightly different messages (like error messages in a catch). Adze offers a new sealTag terminator that will seal your configuration into a template literal tag function to further simplify your logging. import adze from 'adze';
// Let's create a reusable ERR tag with emoji's, timestamps, and the "my-module" namespace.
const ERR = adze.withEmoji.timestamp.ns('my-module').sealTag();
try {
// do something that could fail...
} catch (e) {
ERR`Printing my error as an error log! ${e}`;
}
There is much, much more to Adze than what I can present in this post, but please check it out at https://adzejs.com and let me know what you think! Try it out!