Skip to content

Commit adbdf74

Browse files
committed
feat: add reveal log file
Signed-off-by: Innei <tukon479@gmail.com>
1 parent 8445bd9 commit adbdf74

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

apps/main/src/tipc/app.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { registerMenuAndContextMenu } from "~/init"
1313
import { clearAllData, getCacheSize } from "~/lib/cleaner"
1414
import { store, StoreKey } from "~/lib/store"
1515
import { registerAppTray } from "~/lib/tray"
16-
import { logger } from "~/logger"
16+
import { logger, revealLogFile } from "~/logger"
1717
import {
1818
cleanupOldRender,
1919
getCurrentRenderManifest,
@@ -348,6 +348,10 @@ ${content}
348348
store.set(StoreKey.CacheSizeLimit, input)
349349
}
350350
}),
351+
352+
revealLogFile: t.procedure.action(async () => {
353+
return revealLogFile()
354+
}),
351355
}
352356

353357
interface Sender extends Electron.WebContents {

apps/main/src/window.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,7 @@ export function createWindow(
164164
// source-code-font: For code such as Elements panel
165165
// monospace-font: For sidebar such as Event Listener Panel
166166
const css = `
167-
:root {
168-
--source-code-font-family: consolas;
169-
--source-code-font-size: 13px;
170-
--monospace-font-family: consolas;
171-
--monospace-font-size: 13px;
167+
:root {--devtool-font-family: consolas, operator mono, Cascadia Code, monospace;--source-code-font-family: var(--devtool-font-family);--source-code-font-size: 13px;--monospace-font-family: var(--devtool-font-family);--monospace-font-size: 13px;
172168
}`
173169
window.webContents.devToolsWebContents?.executeJavaScript(`
174170
const overriddenStyle = document.createElement('style');

apps/renderer/src/modules/settings/tabs/data-control.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ export const SettingDataControl = () => {
112112
},
113113
isElectronBuild && AppCacheLimit,
114114
isElectronBuild && CleanCache,
115+
isElectronBuild && {
116+
type: "title",
117+
value: t("general.data_file.label"),
118+
},
119+
isElectronBuild && {
120+
label: t("general.log_file.label"),
121+
description: t("general.log_file.description"),
122+
buttonText: t("general.log_file.button"),
123+
action: () => {
124+
tipcClient?.revealLogFile()
125+
},
126+
},
115127
]}
116128
/>
117129
</div>

locales/settings/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
"general.auto_group.label": "Auto Group",
112112
"general.cache": "Cache",
113113
"general.data": "Data",
114+
"general.data_file.label": "Data File",
114115
"general.data_persist.description": "Persist data locally to enable offline access and local search.",
115116
"general.data_persist.label": "Persist data for offline usage",
116117
"general.export.button": "Export",
@@ -123,6 +124,9 @@
123124
"general.group_by_date.label": "Group by date",
124125
"general.language": "Language",
125126
"general.launch_at_login": "Launch at login",
127+
"general.log_file.button": "Reveal",
128+
"general.log_file.description": "Reveal the log file in the system.",
129+
"general.log_file.label": "Log File",
126130
"general.mark_as_read.hover.description": "Automatically mark entries as read when hovered.",
127131
"general.mark_as_read.hover.label": "Mark as read when hovering",
128132
"general.mark_as_read.render.description": "Automatically mark single-level entries (e.g. social media posts, pictures, video views) as read when they enter the view.",

0 commit comments

Comments
 (0)