(flag: 'debug' | 'info' | 'error', msg: string)
| 9 | } |
| 10 | |
| 11 | private log(flag: 'debug' | 'info' | 'error', msg: string) { |
| 12 | if (!this.window || this.window.isDestroyed()) { |
| 13 | return |
| 14 | } |
| 15 | const time = format(new Date(), 'yyyy/MM/dd HH:mm:ss') |
| 16 | const message = `[${time}] [${flag}] : ${msg}` |
| 17 | this.window.webContents.send('APP-On-Log', 'APP-On-Log', message) |
| 18 | } |
| 19 | |
| 20 | debug(msg: string) { |
| 21 | this.log('debug', msg) |