@zero-version/logging.style.npm
v9.9.14
Published
NPM style implementation of @zero-version/logging.
Downloads
10
Readme
NPM style implementation of @zero-version/logging.
Usage
This logger provides 'NPM' style logging.
import { logLevelEnum } from '@zero-version/logging';
import { loggerConsole } from '@zero-version/logging.console';
import { loggerLevel } from '@zero-version/logging.level';
import { loggerNpmStyle } from '@zero-version/logging.style.npm';
import chalk from 'chalk';
const name = 'my-app';
const console = loggerConsole();
const level = loggerLevel(console, logLevelEnum.info);
const logger = loggerNpmStyle(level, name);
logger.info('');
logger.info(chalk.magenta(`=== Running some process ===`));
logger.debug('just doing some low-level checking');
logger.info('doing something amazing');
logger.info(chalk.magenta(`=== Running some other process ===`));
logger.debug('just doing some low-level checking');
logger.info('doing something amazing');
logger.info('doing something else');
logger.info('doing a third thing');
logger.warn('oops...something may have gone wrong');
logger.error('oops...something _definitely_ went wrong');
logger.info('');
The code above would produce console logs like the following:
Support ☕
Are you using a package I've developed and finding it useful? Or have you looked at one of my repositories and learnt something new? If so, please consider buying me a coffee. Thanks!