Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(logId: string) {
this.logId = logId
this.logFileName = `${formatDate('YYYY-MM')}.log`
this.logger = electronLog.create(logId)
this.logger.transports.file.resolvePath = () => {
return path.resolve(LOGS_PATH, this.logFileName)
}
const isDev = process.env.NODE_ENV === 'development' ? ' [dev]' : ''
this.logger.transports.file.format = `[{y}-{m}-{d} {h}:{i}:{s}.{ms}] [{level}]${isDev} {text}`
this.logger.transports.console.format = '[{level}] {text}'
}