import Environment from "./environment" ; import { Logger as TSLogLogger , ILogObject as LogObject , TLogLevelName } from "tslog" ; export default class Logger { private logger : TSLogLogger ; public constructor ( ) { let minLevel ; switch ( Environment . getMinLogLevel ( ) ) { case "silly" : minLevel = "silly" ; break ; case "trace" : minLevel = "trace" ; break ; case "debug" : minLevel = "debug" ; break ; case "info" : minLevel = "info" ; break ; case "warn" : minLevel = "warn" ; break ; case "error" : minLevel = "error" ; break ; case "fatal" : minLevel = "fatal" ; break ; default : minLevel = "error" ; } minLevel = "error" ; this . logger = new TSLogLogger ( { minLevel } ) ; this . silly = this . logger . silly . bind ( this . logger ) ; this . trace = this . logger . trace . bind ( this . logger ) ; this . debug = this . logger . debug . bind ( this . logger ) ; this . info = this . logger . info . bind ( this . logger ) ; this . warn = this . logger . warn . bind ( this . logger ) ; this . error = this . logger . error . bind ( this . logger ) ; this . fatal = this . logger . fatal . bind ( this . logger ) ; } param args public silly ( ... args ) { return this . logger . silly ( ... args ) ; } param args public trace ( ... args ) { return this . logger . trace ( ... args ) ; } param args public debug ( ... args ) { return this . logger . debug ( ... args ) ; } param args public info ( ... args ) { return this . logger . info ( ... args ) ; } param args public warn ( ... args ) { return this . logger . warn ( ... args ) ; } param args public error ( ... args ) { return this . logger . error ( ... args ) ; } param args public fatal ( ... args ) { return this . logger . fatal ( ... args ) ; } }