2.0.2 • Published 4 years ago

typescript-loggable v2.0.2

Weekly downloads
33
License
-
Repository
github
Last release
4 years ago

Typescript-loggable

npm version Build Status

typescript-loggable is a tool which encapsulates Winston making it cleaner and simple to be used.

Usage

import { Logger } from 'typescript-loggable';

const logger = new Logger();
logger.error('this is my error log');

You can also inject the logger using typescript-ioc (Kudos to Thiago Bustamante):

import { Inject } from 'typescript-ioc';
import { Logger } from 'typescript-loggable'

export class MyLogClass {

    @Inject
    private logger: Logger;

    public myLogger(){
        this.logger.error('error log content');
    }

}