@skyhookadventure/lambda-logger
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

Skyhook Lambda Logger

Built with typescript version dependants license

Exports a pre-configured loglevel logger.

Use

import log from '@skyhookadventure/lambda-logger';

// In descending order
log.error({ success: false });
log.warn({ success: 'maybe' });
log.info({ success: true });
log.debug({ success: true }); // Doesn't show by default

// Enable debug
process.env.LOG_LEVEL = 'debug';

Guidelines

  1. Don't log private data (e.g. don't log a request object if it has a username in it).
  2. 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.

Readme

Keywords

none

Package Sidebar

Install

npm i @skyhookadventure/lambda-logger

Weekly Downloads

1

Version

3.0.1

License

MIT

Unpacked Size

202 kB

Total Files

9

Last publish

Collaborators

  • alan-cooney
  • mwycliffe