From e3730edcd4fc024135c72f7888775d583f17b564 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Sat, 24 Sep 2022 13:50:32 +0530 Subject: [PATCH] also log to disk while logging --- src/utils/logging/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/utils/logging/index.ts b/src/utils/logging/index.ts index 55d35339d..6765e5121 100644 --- a/src/utils/logging/index.ts +++ b/src/utils/logging/index.ts @@ -3,6 +3,8 @@ import { convertBytesToHumanReadable } from 'utils/file/size'; import { formatDateTime } from 'utils/time'; import { saveLogLine, getLogs } from 'utils/storage'; import { isDEVSentryENV } from 'constants/sentry'; +import isElectron from 'is-electron'; +import ElectronService from 'services/electron/common'; export function addLogLine(log: string) { if (isDEVSentryENV()) { @@ -12,6 +14,9 @@ export function addLogLine(log: string) { timestamp: Date.now(), logLine: log, }); + if (isElectron()) { + ElectronService.logToDisk(log); + } } export const addLocalLog = (getLog: () => string) => {