1.0.1 • Published 7 years ago

tir v1.0.1

Weekly downloads
40
License
-
Repository
github
Last release
7 years ago

Tir

It's just a wrapper with colorization around Winston.

Installation

npm install tir

Synopsis

Tir.<info | warn | error | log>

Example

Usage

import { Log } from 'tir';

Log.info('message %j', { x: 1 });

The first argument is a string containing zero or more placeholder tokens. Each placeholder token is replaced with the converted value from the corresponding argument. Supported placeholders are:

  • %s - String.
  • %d - Number (integer or floating point value).
  • %i - Integer.
  • %f - Floating point value.
  • %j - JSON. Replaced with the string 'Circular' if the argument contains circular references.
  • %% - single percent sign ('%'). This does not consume an argument.

.info

Information message

Log.info('Information %s', 'message');

.warn

Warning message

Log.warn('Warning %s', 'message');

.error

Error message

Log.error('Error %s', 'message');

.log

Universal method

import { Log as Tir } from 'tir';

Tir.log('info', 'Information %s', 'message');

License

The library is licensed under the MIT (LICENSE.txt) license.