Fix 'Unable to load preload script' (fix #934)

No reason to use loglevel in the *app*.
It makes sense in the CLI, but in the app console.{info,log,...} is totally fine.
This commit is contained in:
Ronan Jouchet 2020-04-22 22:02:34 -04:00
parent fafaead442
commit 4fbc3f7503
4 changed files with 4 additions and 9 deletions

View File

@ -16,7 +16,6 @@
"electron-dl": "3.x",
"electron-squirrel-startup": "1.x",
"electron-window-state": "5.x",
"loglevel": "1.x",
"source-map-support": "0.x",
"wurl": "2.x"
},

View File

@ -3,7 +3,6 @@ import * as os from 'os';
import * as path from 'path';
import { BrowserWindow } from 'electron';
import * as log from 'loglevel';
import wurl from 'wurl';
const INJECT_CSS_PATH = path.join(__dirname, '..', 'inject/inject.css');
@ -60,7 +59,7 @@ export function debugLog(browserWindow: BrowserWindow, message: string): void {
setTimeout(() => {
browserWindow.webContents.send('debug', message);
}, 3000);
log.info(message);
console.info(message);
}
export function getAppIcon(): string {

View File

@ -1,8 +1,6 @@
import * as fs from 'fs';
import * as path from 'path';
import * as log from 'loglevel';
import { isOSX, isWindows, isLinux } from './helpers';
/**
@ -84,6 +82,6 @@ export function inferFlashPath() {
return findFlashOnLinux();
}
log.warn('Unable to determine OS to infer flash player');
console.warn('Unable to determine OS to infer flash player');
return null;
}

View File

@ -11,7 +11,6 @@ import * as fs from 'fs';
import * as path from 'path';
import { ipcRenderer } from 'electron';
import * as log from 'loglevel';
const INJECT_JS_PATH = path.join(__dirname, '..', 'inject/inject.js');
/**
@ -58,9 +57,9 @@ setNotificationCallback(notifyNotificationCreate, notifyNotificationClick);
ipcRenderer.on('params', (event, message) => {
const appArgs = JSON.parse(message);
log.info('nativefier.json', appArgs);
console.info('nativefier.json', appArgs);
});
ipcRenderer.on('debug', (event, message) => {
log.info('debug:', message);
console.info('debug:', message);
});