npm.io
6.0.10 • Published 2 years ago

@balena/jellyfish-logger

Licence
Apache-2.0
Version
6.0.10
Deps
7
Size
24 kB
Vulns
0
Weekly
0
Stars
1
DeprecatedThis package is deprecated

Jellyfish Logger

The Jellyfish backend strongly discourages the use of console.log(). This module provides a set of functions that the backend uses for logging purposes.

Goals

  • The logger takes a request ID parameter to easily filter down logs that correspond to a single system request
  • The logger is able to log uncaught exceptions
  • The logger is able to send logs using different priority levels
  • The logger is able to preserve rich object logs
  • The logger is able to pipe logs to a central location when running in production

Usage

Below is an example how to use this library:

const logger = require('@balena/jellyfish-logger')

logger.warn(context, 'Inserting card', {
    slug: card.slug,
    type: card.type
})