This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

iso-logger
TypeScript icon, indicating that this package has built-in type declarations

0.0.12 • Public • Published

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.

Package Sidebar

Install

npm i iso-logger

Weekly Downloads

27

Version

0.0.12

License

MIT

Unpacked Size

128 kB

Total Files

27

Last publish

Collaborators

  • dylanaubrey