tir
v1.0.1
Published
Logger
Downloads
584
Readme
Tir
It's just a wrapper with colorization around Winston.
Installation
npm install tir
Synopsis
Tir.<info | warn | error | log>
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.