0.0.12 • Published 6 years ago

iso-logger v0.0.12

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

IsoLogger

An isomorphic logger that uses Winston on the server and console on the client.

Build Status codecov Quality Gate License: MIT npm version dependencies Status devDependencies Status

Installation

npm install iso-logger --save

Compilation

The WEB_ENV environment variable must be set to 'true' when you compile your browser bundle in order to exclude Winston from the build.

Usage

// logger.js

import Logger from 'iso-logger';

const level = process.env.NODE_ENV === 'production' ? 'warn' : 'debug';
export default new Logger({ consoleOptions: { level }, winstonOptions: { level } });
// module.js

import logger from './logger';

logger.error('Oops, something went wrong...');
logger.warn('Beware the fury of a patient man.');
logger.info('It is a very sad thing that nowadays there is so little useless information.');

logger.verbose(
  `How doth the little crocodile improve his shining tail. And pour
  the waters of the Nile, on every golden scale. How cheerfully he seems to grin, how
  neatly spreads his claws. And welcomes little fishes in, with gently smiling jaws.`
);

logger.debug('There are only two hard problems in Computer Science: cache invalidation and naming things.');

Documentation

Please read the documentation on the IsoLogger github pages.

License

IsoLogger is MIT Licensed.

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago