npm.io
1.0.1 • Published 9 years ago

tir

Licence
Version
1.0.1
Deps
2
Vulns
0
Weekly
0

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.

Keywords