3.0.1 • Published 4 years ago

@skyhookadventure/lambda-logger v3.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

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 FeatureProvided
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.

2.0.2

4 years ago

3.0.1

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago