1.0.1 • Published 3 years ago

@capnajax/debug v1.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
3 years ago

Cap'n Ajax Debug

Extension and of Vision Media's debug module for extra highlighting and redacting sensitive information.

Installation

$ npm install @capnajax/debug

Usage

All features of the original Vision Media debug module remain available.

Extra Highlighting

For additional colour highlighting of method names and end points, put the names in square brackets. For this to work, DEBUG_COLORS must be set.

debug('[myFunction] called with params', arguments);
// highlights [myFunction] in blue

debug('[GET /my/endpoint] called');
// highlights [GET /my/endpoint] in green

Sensitive information

For logs that may contain sensitive information, there's a debug.sensitive method that will only print if the DEBUG_SENSITIVE environment variable is set.

debug('[myFunction] called with params', arguments);
// if debug is enabled, prints the log message

debug.sensitive('[myFunction] called with params', arguments);
// if debug is enable AND DEBUG_SENSITIVE is set, prints the log message.
1.0.1

3 years ago

1.0.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago