JSPM

  • Created
  • Published
  • Downloads 23445
  • Score
    100M100P100Q137789F
  • License Apache-2.0

A library for shaping your logs.

Package Exports

  • adze

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (adze) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Adze Logo

Build Status npm node-lts

Please visit our official docs at adzejs.com.

Why is this named Adze?

A drawing of a man using an adze to shape a log

Photo from Wikipedia

Adze - a cutting tool that ... is used chiefly for shaping wood.

Adze was chosen as a name for this library to maintain solidarity with the logging puns and to emphasize that this library is a tool for shaping the logs of your application.

Why should I use Adze?

As you may already be aware there are a number of other good JS libraries out there to assist with logging. The focus of Adze is to provide a convenient and clean API, provide first-class TypeScript support, and to empower you to take command of your logs rather than pigeon-hole you into a specific way of handling them.

Here is a list of the features that Adze provides:

  • First-class TypeScript support
  • Runs in both the browser and node
  • A fluent, chainable API for creating logs
  • Log Listeners that empower you to do with your logs as you wish
  • Annotate your logs with namespaces, labels, and other meta data
  • Attractive styling (EMOJI'S INCLUDED and consistent across major browsers)
  • Everything is configurable
  • Create custom log levels
  • A global log store for recalling logs and overriding configuration
  • and much more...

Beyond the new features that Adze provides you, it also wraps the entire console web standard. Read more about the standard here: MDN Console Docs

Here is a simple preview:

Preview of Adze logs

This preview was generated from the same code executed in both the browser (left) and the node (right) environments.

What does the API look like?

As stated above, Adze offers an easy to use, chainable API. To create a log you simply chain together an Adze log instance with a series of modifiers and then end with a terminator. Here's an example of creating a log with emoji's and a namespace:

import { adze } from 'adze';

adze({ use_emoji: true }).ns('tix-456').log('Example log');

The output of this would look like the following:

Preview of Adze logs