logging
v4.2.0
Published
Lightweight informative modern console logging.
Downloads
20,797
Readme
Logging 
Lightweight informative modern console logging.
Install
pnpm add loggingFeatures
- Simple.
- Log levels.
- Nice coloring.
Usage
// ESM only
import createLogger from 'logging';
const logger = createLogger('Feature');
logger.info('Interesting');
// -> [ Feature ] Interesting
logger.warn('Hmmm...', { details });
// -> [ WARNING Feature ] Hmmm... { details object }
logger.error('Not good.', 'Not good at all.', { err }, { context }, { etc });
// -> [ ERROR Feature ] Not good. Not good at all. { err } { context } ...
// uses the debug module, use DEBUG=* or DEBUG=FeatureName to see these items.
logger.debug('Interesting');
// -> [ Feature ] Interesting
