Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 730 Bytes

README.md

File metadata and controls

44 lines (31 loc) · 730 Bytes

Jot

A simple interface for telemetry.

Installation

npm install --save bluefin-jot

or

yarn add bluefin-jot

Basic Usage

// example.js
const {Jot} = require('bluefin-jot')

// create a new jot instance
const jot = new Jot()

// emit log messages
jot.debug('excruciating detail', {withStructuredData: true})
jot.info('normal verbosity', {more: 'details'})
jot.warning('worrisome event')

// emit metrics
jot.magnitude('intensity', 100, {force: 'magnetism'})
jot.count('widgets', 3)

// emit a stack trace
const error = new Error('made a mistake')
jot.error('job failed', error, {jobName: 'setup'})

Run the script with an environment variable:

DEBUG=jot node example.js