1.2.0 • Published 1 year ago
@financial-times/community-js-logger v1.2.0
community-js-logger
Logger for community js projects
Usage
Installation
npm i @financial-times/community-js-logger
Logging
This library exports 4 log levels, debug, info, warn and error.
import logger from '@financial-times/community-js-logger'
logger.info({
event: 'SOME_INTERESTING_EVENT',
detail: {
'oooh': 'isn\'t it interesting that this happened'
}
})
logger.info({
event: 'CALAMITY',
error: new Error('some error object')
})
Setting the log level
Log level can be set via the LOG_LEVEL environment variable, or by setting logger.currentLogLevel
to one of the below values:
SILENT
: suppresses all log messagesDEBUG
: includes debug logs, as well as info, warn and error logs.INFO
: includes info logs, as well as warn and error logs.WARN
: includes info logs, as well as error logsERROR
: include only error logs
1.2.1-alpha.204.0
1 year ago
1.2.0
1 year ago
1.1.0
1 year ago
1.1.0-alpha.0
1 year ago
1.2.0-alpha.0
1 year ago
1.0.1
2 years ago
1.0.0
2 years ago
1.0.0-beta.3
2 years ago
1.0.0-beta.2
2 years ago
1.0.0-beta.1
2 years ago