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:
parent
103c123cc5
commit
e505c63395
@ -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();
|
||||||
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user