lambda-monitor-logger

Logging designed to be used with lambda-monitor

Usage no npm install needed!

<script type="module">
  import lambdaMonitorLogger from 'https://cdn.skypack.dev/lambda-monitor-logger';
</script>

README

lambda-monitor-logger

Build Status Test Coverage Dependabot Status Dependencies NPM Downloads Semantic-Release Gardener

Logging designed to be used with lambda-monitor

Install

Install with npm:

$ npm install --save lambda-monitor-logger

Usage

const { logger, abbrev } = require('lambda-monitor-logger');

logger.error('Keyboard not found. Press F1 to Resume');
// => ERROR: Keyboard not found. Press F1 to Resume

logger.error(abbrev('some really long text'));
// => ERROR: some ... test

This logger will simply log to console and prefix with the debug level.

The available levels are: debug, info, warning, error, critical.

Synonyms like warn are available and the mapping can be found in the source code.

Log Level

The log level can be set through the environment variable LOG_LEVEL (defaults to DEBUG).

Log messages below the currently set log level are completely ignored.