From 21a7149493d7891179553cbc2ceb38470ed376dc Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sun, 17 Oct 2021 14:54:48 +0100 Subject: [PATCH] Fixed mobile build --- packages/app-desktop/app.ts | 4 ++++ packages/lib/services/synchronizer/syncDebugLog.ts | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/app-desktop/app.ts b/packages/app-desktop/app.ts index b14b9a136..701baa35b 100644 --- a/packages/app-desktop/app.ts +++ b/packages/app-desktop/app.ts @@ -43,6 +43,7 @@ import noteListControlsCommands from './gui/NoteListControls/commands/index'; import sidebarCommands from './gui/Sidebar/commands/index'; import appCommands from './commands/index'; import libCommands from '@joplin/lib/commands/index'; +import { homedir } from 'os'; const electronContextMenu = require('./services/electron-context-menu'); // import populateDatabase from '@joplin/lib/services/debug/populateDatabase'; @@ -361,6 +362,9 @@ class Application extends BaseApplication { syncDebugLog.enabled = false; if (dir.endsWith('dev-desktop-2')) { + syncDebugLog.addTarget(TargetType.File, { + path: `${homedir()}/synclog.txt`, + }); syncDebugLog.enabled = true; syncDebugLog.info(`Profile dir: ${dir}`); } diff --git a/packages/lib/services/synchronizer/syncDebugLog.ts b/packages/lib/services/synchronizer/syncDebugLog.ts index 10da5befd..8bcdea61c 100644 --- a/packages/lib/services/synchronizer/syncDebugLog.ts +++ b/packages/lib/services/synchronizer/syncDebugLog.ts @@ -2,12 +2,8 @@ // related events. In particular, it logs notes and folders being saved, and the // relevant sync operations. Enable it in app.ts -import Logger, { TargetType } from '../../Logger'; -import { homedir } from 'os'; +import Logger from '../../Logger'; const syncDebugLog = new Logger(); -syncDebugLog.addTarget(TargetType.File, { - path: `${homedir()}/synclog.txt`, -}); export default syncDebugLog;