sioslife-logger

1.0.0 • Public • Published

sioslife-logger

Simple, colorful logging by siosLIFE.

Installation

npm install --save sioslife-logger

Usage

Create a logger:

var Logger = require('sioslife-logger');
var logger = Logger('My App');

This logger has the methods log, warn and error. It also has a modifier for each style in chalk.

Use it like this:

logger.log('Starting');
//=> [My App] Starting

logger.green.log('Started');
// Writes in green to console.log:
//=> [My App] Started

// These write to console.error instead:
logger.red.error('Something bad happened');
logger.bgRed.error('Something very bad happened');

It's also possible to create loggers for sub-domains of your application:

var Logger = require('sios-logger');
var dbLogger = Logger('My App', 'DB');

dbLogger.log('Connecting');
//=> [My App]:[DB] Connecting

License

MIT © siosLIFE

Readme

Keywords

Package Sidebar

Install

npm i sioslife-logger

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • bsonntag