1.0.12 • Published 3 years ago

@integromat/debug v1.0.12

Weekly downloads
405
License
-
Repository
github
Last release
3 years ago

Debug

A simple wrapper around debug module that adds Overseer integration.

Example usage

const debug = require('@integromat/debug');

const appLogger = debug('imt:app');
const appRequestLogger = debug('imt:app:request'); // either create entirely new function
const appResponseLogger = appLogger.extend('response'); // or extend existing one

appLogger('abc');         // ... imt:app abc
appRequestLogger('def');  // ... imt:app:request def
appResponseLogger('ghj'); // ... imt:app:response ghj

const obj = {};
appLogger('Object: %O', obj); // supports logging of objects
appLogger(`Object: ${JSON.stringify(obj, null, 2)}`); // but preferred way for deeply nested objects is template literal and JSON.stringify

appLogger(() => `Object: ${JSON.stringify(obj, null, 2)}`); // for computationally intense operations use lambda functions
appLogger(() => ['Object: %O', obj]); // if there are multiple arguments, it's okay to return array
1.0.12

3 years ago

1.0.9

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago