Package Exports
- lambda-monitor-logger
- lambda-monitor-logger/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lambda-monitor-logger) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
lambda-monitor-logger
Logging designed to be used with lambda-monitor
Install
Install with npm:
$ npm install --save lambda-monitor-logger
Usage
import { logger, abbrev } from '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.
Abbrev Options
stripLineBreaks
Type: boolean
Default: true
When set to true, line breaks are stripped.
maxLength
Type: integer
Default: 512
The maximum output length.
replace
Type: Array
Default: []
Input needs to be of format [[<STRING|REGEX>, <STRING|FUNCTION>], ...]
Allow custom replacement rules