Skip to content

Commit

Permalink
Added electron log and debugging for auto-updater
Browse files Browse the repository at this point in the history
  • Loading branch information
megastary committed Dec 12, 2019
1 parent dbd25a0 commit 5ace0da
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"email": "[email protected]",
"url": "https://houby-studio.eu/"
},
"version": "0.0.4",
"version": "0.0.5",
"license": "MIT",
"copyright": "Copyright © 2020 Houby Studio",
"build": {
Expand Down Expand Up @@ -56,6 +56,7 @@
"postinstall": "electron-builder install-app-deps"
},
"dependencies": {
"electron-log": "^4.0.0",
"electron-updater": "^4.2.0",
"source-map-support": "^0.5.12"
},
Expand Down
4 changes: 4 additions & 0 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { app, BrowserWindow } from 'electron'
import * as path from 'path'
import { format as formatUrl } from 'url'
import { autoUpdater } from 'electron-updater'
const log = require('electron-log')

const isDevelopment = process.env.NODE_ENV !== 'production'

Expand Down Expand Up @@ -61,5 +62,8 @@ app.on('activate', () => {
// create main BrowserWindow when electron is ready
app.on('ready', () => {
mainWindow = createMainWindow()
log.transports.file.level = 'info'
autoUpdater.logger = log
autoUpdater.logger.transports.file.level = 'info'
autoUpdater.checkForUpdatesAndNotify()
})
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2558,6 +2558,11 @@ electron-download@^4.1.0:
semver "^5.4.1"
sumchecker "^2.0.2"

electron-log@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/electron-log/-/electron-log-4.0.0.tgz#9315e4a5e6be5e2a158909856b2d2cb4d760cd6d"
integrity sha512-pj5Om0XoImjoq60zgvTv86W+2+7VMQIW0jmKWkXXTTjiC2L2WNfNDfMbpqo8Qj2szY1LsVyFhgRNBLXVrYNDJQ==

[email protected]:
version "21.2.0"
resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-21.2.0.tgz#cc225cb46aa62e74b899f2f7299b396c9802387d"
Expand Down

0 comments on commit 5ace0da

Please sign in to comment.