log writer for AWS Lambda environment
- Printf-like message formatting
- Configure log level visbility threshold through
LOG_LEVEL
env variable (defaults tonotice
) - Extra debug output can be controlled via
LOG_DEBUG
env variable (fallbacks toDEBUG
if provided) - Object inspection depth defaults to
4
, but can be overriden viaLOG_INSPECT_DEPTH
(fallbacks toDEBUG_DEPTH
if provided) - Writes logs via
console.error
(notprocess.stderr
) to ensure logs are accompanied in CloudWatch by AWS prefixes
At beginning of main module of your program invoke:
require("log-aws-lambda")();
Note: Value of LOG_TIME
env var is ignored, as AWS logs by default are accompanied with absolute timestamps
$ npm test