import * as winston from 'winston' ; import debug from 'debug' ; import { buildWinstonLogger } from './build-winston-logger' ; export class Logger { private static winstonLogger : winston . Logger = buildWinstonLogger ( ) ; private debugger ; constructor ( private readonly context ? ) { this . debugger = debug ( context ) ; } info ( message , ... args ) { Logger . winstonLogger . info ( message , { context : this . context , meta : { args } , } ) ; } warn ( message , ... args ) { Logger . winstonLogger . warn ( message , { context : this . context , meta : { args } , } ) ; } error ( message , ... args ) { Logger . winstonLogger . error ( message ?. stack ? message . stack : message , { context : this . context , meta : { args } , } ) ; } debug ( ... args ) { this . debugger ( ... args ) ; } }