@mymunters/lambda-logger
v1.0.6
Published
## Example
Downloads
246
Readme
Simple logger for Node.js in AWS Lambda
Example
import { log } from '@mymunters/lambda-logger'
log.info('Hello world!')
log.info({ abc: 'Look, an object!'})
log.info('Multiple params can be sent', 12345, ['a', 'b', 'c'], true)
Change log level
import { log, LogLevel } from '@mymunters/lambda-logger'
log.level = LogLevel.DEBUG
Set default log level in environment variables
When imported, the logger looks for the environment variable MUNTERS_LOG_LEVEL to set the initial log level. This is optional
Example (env.yml)
dev:
MUNTERS_LOG_LEVEL: DEBUG
test:
MUNTERS_LOG_LEVEL: WARN
prod:
MUNTERS_LOG_LEVEL: INFO
Available log levels are: DEBUG, INFO, WARN, ERROR and OFF
The default log level is INFO