From d86ca564cf027a7878d475f880a3c2d89535a9e7 Mon Sep 17 00:00:00 2001 From: "Mr. Stallion" Date: Wed, 1 Jul 2020 09:33:36 -0500 Subject: [PATCH] Log config --- electron/main.ts | 4 ++-- electron/window.ts | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/electron/main.ts b/electron/main.ts index 9ffb793..4ff3952 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -302,8 +302,8 @@ function showPatchNotes(): void { function onReady(): void { const logLevel = (process.env.NODE_ENV === 'production') ? 'info' : 'silly'; - log.transports.file.level = logLevel; - log.transports.console.level = logLevel; + log.transports.file.level = settings.risingSystemLogLevel || logLevel; + log.transports.console.level = settings.risingSystemLogLevel || logLevel; log.transports.file.maxSize = 5 * 1024 * 1024; log.info('Starting application.'); diff --git a/electron/window.ts b/electron/window.ts index ada88ea..842304d 100644 --- a/electron/window.ts +++ b/electron/window.ts @@ -4,15 +4,16 @@ import log from 'electron-log'; //tslint:disable-line:match-default-export-name import {GeneralSettings} from './common'; import Window from './Window.vue'; +const params = <{[key: string]: string | undefined}>qs.parse(window.location.search.substr(1)); +const settings = JSON.parse(params['settings']!); + const logLevel = (process.env.NODE_ENV === 'production') ? 'info' : 'silly'; -log.transports.file.level = logLevel; -log.transports.console.level = logLevel; +log.transports.file.level = settings.risingSystemLogLevel || logLevel; +log.transports.console.level = settings.risingSystemLogLevel || logLevel; log.transports.file.maxSize = 5 * 1024 * 1024; -const params = <{[key: string]: string | undefined}>qs.parse(window.location.search.substr(1)); -const settings = JSON.parse(params['settings']!); //tslint:disable-next-line:no-unused-expression new Window({ el: '#app',