File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 11import { Menu , MenuItem } from 'electron' ;
22import { autoUpdater } from 'electron-updater' ;
33import type { Menubar } from 'menubar' ;
4- import { resetApp , takeScreenshot } from './utils' ;
4+ import { openLogsDirectory , resetApp , takeScreenshot } from './utils' ;
55
66export default class MenuBuilder {
77 private checkForUpdatesMenuItem : MenuItem ;
@@ -59,6 +59,10 @@ export default class MenuBuilder {
5959 accelerator : 'CommandOrControl+S' ,
6060 click : ( ) => takeScreenshot ( this . menubar ) ,
6161 } ,
62+ {
63+ label : 'View Application Logs' ,
64+ click : ( ) => openLogsDirectory ( ) ,
65+ } ,
6266 {
6367 label : 'Reset App' ,
6468 click : ( ) => {
Original file line number Diff line number Diff line change 11import fs from 'node:fs' ;
22import os from 'node:os' ;
3- import { dialog } from 'electron' ;
3+ import path from 'node:path' ;
4+ import { dialog , shell } from 'electron' ;
45import log from 'electron-log' ;
56import type { Menubar } from 'menubar' ;
67
@@ -35,3 +36,14 @@ export function resetApp(mb: Menubar) {
3536 mb . app . quit ( ) ;
3637 }
3738}
39+
40+ export function openLogsDirectory ( ) {
41+ const logDirectory = path . dirname ( log . transports . file ?. getFile ( ) ?. path ) ;
42+
43+ if ( ! logDirectory ) {
44+ log . error ( 'Could not find log directory!' ) ;
45+ return ;
46+ }
47+
48+ shell . openPath ( logDirectory ) ;
49+ }
You can’t perform that action at this time.
0 commit comments