From 60881eaf3e43f48cb7aaa9d10f2c0b857d0c3e36 Mon Sep 17 00:00:00 2001 From: Keith Paterson Date: Thu, 3 Jun 2021 16:00:46 +0200 Subject: [PATCH] Logfile in user dir --- src/renderer/components/SettingsPanel.vue | 2 -- src/renderer/utils/logger.js | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/SettingsPanel.vue b/src/renderer/components/SettingsPanel.vue index 13e7dc5..66f36d2 100644 --- a/src/renderer/components/SettingsPanel.vue +++ b/src/renderer/components/SettingsPanel.vue @@ -223,10 +223,8 @@ return { ok: true, activeName: '0', scanStoreLogging: false } }, mounted () { - console.debug('Mount') this.$store.watch( function (state) { - console.debug('Mount ' + JSON.stringify(state)) return state.Settings.settings }, () => { this.loggingChanged() } diff --git a/src/renderer/utils/logger.js b/src/renderer/utils/logger.js index 89b8f2e..2fafd4e 100644 --- a/src/renderer/utils/logger.js +++ b/src/renderer/utils/logger.js @@ -14,9 +14,12 @@ d.getMilliseconds() + '.log'; var logStream = null; var loggerInit = function (logging) { + debugger; if (logging) { try { - logStream = require('fs').createWriteStream( fName, {autoClose: true}); + const homedir = require('os').homedir(); + const logFileName = require('path').join(homedir, fName); + logStream = require('fs').createWriteStream( logFileName, {autoClose: true}); } catch (error) { console.error('Logging not possible ' + error); }