Skyhook Lambda Logger
Exports a pre-configured loglevel logger.
Use
import log from '@skyhookadventure/lambda-logger';
log.error({ success: false });
log.warn({ success: 'maybe' });
log.info({ success: true });
log.debug({ success: true });
process.env.LOG_LEVEL = 'debug';
Guidelines
- Don't log private data (e.g. don't log a request object if it has a username in it).
- Focus on logging small objects that can be searched rather than strings
Setting the output log level
By default the log level used is INFO (i.e. HTTP errors won't be shown). In (Jest) testing environments the level is set
to ERROR instead.
You can override this by setting process.env.LOG_LEVEL
.
Checklist
CD Feature | Provided |
---|
✅ | Typescript |
✅ | Linting (AirBnB + Prettier) |
✅ | Unit tests (Jest) |
✅ | Coverage check (ideally 100% with Jest) |
✅ | Github Continuous Deployment |
Built by Skyhook
This module is contributed by the team at Skyhook.