const log = require ( 'electron-log' ) ; log . transports . file . level = 'warn' ; if ( process . env . NODE_ENV !== 'production' ) { log . transports . console . level = 'silly' ; } else { log . transports . console . level = 'debug' ; } export default class LoggerWithFilePrefix { filenamePath : string ; electronLog : typeof log ; constructor ( _filenamePath ) { this . filenamePath = _filenamePath ; this . electronLog = log ; } error ( ... args ) { this . electronLog . error ( this . filenamePath , ':' , ... args ) ; } warn ( ... args ) { this . electronLog . warn ( this . filenamePath , ':' , ... args ) ; } info ( ... args ) { this . electronLog . info ( this . filenamePath , ':' , ... args ) ; } verbose ( ... args ) { this . electronLog . verbose ( this . filenamePath , ':' , ... args ) ; } debug ( ... args ) { this . electronLog . debug ( this . filenamePath , ':' , ... args ) ; } silly ( ... args ) { this . electronLog . silly ( this . filenamePath , ':' , ... args ) ; } }