1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-17 15:37:57 +01:00

assign electron-log to updater

This commit is contained in:
Kyle Spearrin 2018-02-24 22:54:14 -05:00
parent 103c123cc5
commit e505c63395
2 changed files with 2 additions and 37 deletions

View File

@ -4,10 +4,10 @@ import {
MenuItem, MenuItem,
shell, shell,
} from 'electron'; } from 'electron';
import log from 'electron-log';
import { autoUpdater } from 'electron-updater'; import { autoUpdater } from 'electron-updater';
import { Main } from '../main'; import { Main } from '../main';
import { UpdaterLogger } from '../scripts/updaterLogger';
import { import {
isAppImage, isAppImage,
isDev, isDev,
@ -25,7 +25,7 @@ export class UpdaterMain {
private canUpdate = false; private canUpdate = false;
constructor(private main: Main) { constructor(private main: Main) {
autoUpdater.logger = new UpdaterLogger(main.logService); autoUpdater.logger = log;
const linuxCanUpdate = process.platform === 'linux' && isAppImage(); const linuxCanUpdate = process.platform === 'linux' && isAppImage();
const windowsCanUpdate = process.platform === 'win32' && !isWindowsStore() && !isWindowsPortable(); const windowsCanUpdate = process.platform === 'win32' && !isWindowsStore() && !isWindowsPortable();

View File

@ -1,35 +0,0 @@
import { Logger } from 'electron-updater';
import { LogService } from 'jslib/abstractions/log.service';
export class UpdaterLogger implements Logger {
constructor(private logService: LogService) { }
debug(message: string): void {
this.logService.debug(message);
}
info(message?: any): void {
if (message == null) {
return;
}
this.logService.info(message);
}
warn(message?: any): void {
if (message == null) {
return;
}
this.logService.warning(message);
}
error(message?: any): void {
if (message == null) {
return;
}
this.logService.error(message);
}
}