@plmtest/cosmos-logger
v1.0.2
Published
Package that provides a common logger
Downloads
628
Readme
PLM Fleet Logger
This package provides a consistent logging implementation for all PLM Fleet services (and packages).
Usage
Creating a new Logger
const { createLogger } = require('@plmtest/cosmos-logger')
const config = {
name: 'my-logger',
level: 'info'
}
const logger = createLogger(config)Configuration
Various options for the logger can be configured. By default, the following configuration is used:
const config = {
name: 'N/A',
level: LOG_LEVELS.INFO,
src: true,
mode: LOG_MODES.DEFAULT, // DEFAULT, SIMPLE, SHORT, LONG, JSON, INSPECT
color: true,
jsonIndent: 2
}