Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
new Promise((resolve, reject) => {
log.verbose(`[GUI main] JRE path: ${jre.jreDir()}`);
let shouldInstall = false;
try {
if (!fs.existsSync(jre.driver())) {
shouldInstall = true;
}
} catch (err) {
log.silly(err);
shouldInstall = true;
}
if (shouldInstall) {
log.info(
"[GUI main] JRE is not found and starts installation of a JRE"
);
jre.install(err => {
log.info(
`[GUI main] JRE installation has been finished ${
err ? `with an error: ${err}` : ""
}`
);
// noinspection SpellCheckingInspection
if (err && err !== "Smoketest failed.") {
log.error("[GUI main] JRE installation failed and cleaning up");
private log(logLevel: LogLevel, message: string, data: any[] = []): void {
if (data && data.length > 0) {
data.forEach((param) => {
message += `, '${param && typeof param}': ${JSON.stringify(param)}`;
});
}
if (!isElectronQA) {
switch (logLevel) {
case 'error': electronLog.error(message); break;
case 'warn': electronLog.warn(message); break;
case 'info': electronLog.info(message); break;
case 'verbose': electronLog.verbose(message); break;
case 'debug': electronLog.debug(message); break;
case 'silly': electronLog.silly(message); break;
default: electronLog.info(message);
}
}
this.sendToCloud(this.formatLogMsg(logLevel, message));
}
this.silly = function silly() {
_logger.silly(arguments);
};
this.sender.setLog((m: string, message: Message.Message) => {
this.log(m, message.type, message.id);
ElectronLog.silly(message);
});
}