source/lib/VBLog.js
// Display a dialog box for specifying a log file

Display a dialog box for specifying a log file
Display a dialog box for specifying a log file
doDialog(config, dirname, filename) {
    dialog.showSaveDialog({
      title: 'Log File',
      defaultPath: path.join(dirname, filename)
    }, (pathname) => {
      if (pathname) {
        this.logStream = fs.createWriteStream(pathname, {
          flags: 'a',
          defaultEncoding: 'utf8'
        }).on('error', (err) => {
          console.log('Log write error:', err)
          this.logging = false
          this.logStream = null
        }).on('close', () => {
          this.logging = false
          this.logStream = null
        })
        this.logging = true
        this.write('Logging started' + os.EOL)
        config.logfilePath = pathname
        ipcRenderer.send('update-log-file', pathname)
      }
    })
  }
doDialog ( config , dirname , filename ) { dialog . showSaveDialog ( { title : 'Log File' , defaultPath : path . join ( dirname , filename ) } , ( pathname ) => { if ( pathname ) { this . logStream = fs . createWriteStream ( pathname , { flags : 'a' , defaultEncoding : 'utf8' } ) . on ( 'error' , ( err ) => { console . log ( 'Log write error:' , err ) this . logging = false this . logStream = null } ) . on ( 'close' , ( ) => { this . logging = false this . logStream = null } ) this . logging = true this . write ( 'Logging started' + os . EOL ) config . logfilePath = pathname ipcRenderer . send ( 'update-log-file' , pathname ) } } ) }
Display a dialog box for specifying a log file
Display a dialog box for specifying a log file
// Update the Renderer's config object
 // Send IPC to Main to update its config object
