i using electron-quick-start app windows machine. have added logging statements in main.js follows:
const electron = require('electron') // module control application life. const app = electron.app // module create native browser window. const browserwindow = electron.browserwindow // keep global reference of window object, if don't, window // closed automatically when javascript object garbage collected. let mainwindow console.log("test"); function createwindow () { // create browser window. mainwindow = new browserwindow({width: 800, height: 600}) // , load index.html of app. mainwindow.loadurl(`file://${__dirname}/index.html`) // open devtools. mainwindow.webcontents.opendevtools() // emitted when window closed. mainwindow.on('closed', function () { // dereference window object, store windows // in array if app supports multi windows, time // when should delete corresponding element. mainwindow = null }) console.log("test"); } // method called when electron has finished // initialization , ready create browser windows. // apis can used after event occurs. app.on('ready', createwindow) // quit when windows closed. app.on('window-all-closed', function () { // on os x common applications , menu bar // stay active until user quits explicitly cmd + q if (process.platform !== 'darwin') { app.quit() } }) app.on('activate', function () { // on os x it's common re-create window in app when // dock icon clicked , there no other windows open. if (mainwindow === null) { createwindow() } }) // in file can include rest of app's specific main process // code. can put them in separate files , require them here.
in package.json file have replaced line "start": "electron ."
line "start": "electron . --enable-logging"
here when call npm start
.
where mistake? how can enable logging under windows?
set environment variable %electron_enable_logging%
Comments
Post a Comment