Skip to main content

js logger

Javascript and typescript logger for MapColonies based on pino.

Usage

import jsLogger from '@map-colonies/js-logger';

const logger = jsLogger();

logger.info('hello world');

logger.error({hello: 'world'});

for more detailed usage check the pino documentation.

Configuration

nametypedefault valuedescription
enabledbooleantrueenables logging
levelstring'info'one of the supported level or silent to disable logging
prettyPrintbooleanfalsepretty print for developing purposes
redactarrayundefinedarray of paths in object to be redacted from the log
destinationnumber / string1The stream to send the log to, or file
baseobject{pid: process.pid, hostname: os.hostname}Key-value object added as child logger to each log line
pinoCallerbooleanfalseadds the call site of each log message to the log output
note

This page was generated from a remote source. you can find it on https://github.com/MapColonies/js-logger/blob/master/README.md