@jobscale/create-logger

0.1.0 • Public • Published

@jobscale/create-logger

Description

log level and priority

level priority color default
error 0 red
warn 1 yellow
info 2 white
debug 3 white
log 4 white
dir 4 white
trace 4 white

Installation

npm i @jobscale/create-logger

Examples

logging

const { createLogger } = require('@jobscale/create-logger');

const logger = createLogger('info);
logger.error('error', { timestamp: Date.now() });
logger.warn('warn', { timestamp: Date.now() });
logger.info('info', { timestamp: Date.now() });
logger.debug('debug', { timestamp: Date.now() });
logger.log('log', { timestamp: Date.now() });

logging (ES)

import { createLogger } from '@jobscale/create-logger';

const logger = createLogger('info);
logger.error('error', { timestamp: Date.now() });
logger.warn('warn', { timestamp: Date.now() });
logger.info('info', { timestamp: Date.now() });
logger.debug('debug', { timestamp: Date.now() });
logger.log('log', { timestamp: Date.now() });

test

npm test

Readme

Keywords

Package Sidebar

Install

npm i @jobscale/create-logger

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

8.34 kB

Total Files

6

Last publish

Collaborators

  • jobscale