Skip to content

biharck/typescript-loggable

Repository files navigation

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');
    }

}