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 1
1
import { Menu , MenuItem } from 'electron' ;
2
2
import { autoUpdater } from 'electron-updater' ;
3
3
import type { Menubar } from 'menubar' ;
4
- import { resetApp , takeScreenshot } from './utils' ;
4
+ import { openLogsDirectory , resetApp , takeScreenshot } from './utils' ;
5
5
6
6
export default class MenuBuilder {
7
7
private checkForUpdatesMenuItem : MenuItem ;
@@ -59,6 +59,10 @@ export default class MenuBuilder {
59
59
accelerator : 'CommandOrControl+S' ,
60
60
click : ( ) => takeScreenshot ( this . menubar ) ,
61
61
} ,
62
+ {
63
+ label : 'View Application Logs' ,
64
+ click : ( ) => openLogsDirectory ( ) ,
65
+ } ,
62
66
{
63
67
label : 'Reset App' ,
64
68
click : ( ) => {
Original file line number Diff line number Diff line change 1
1
import fs from 'node:fs' ;
2
2
import os from 'node:os' ;
3
- import { dialog } from 'electron' ;
3
+ import path from 'node:path' ;
4
+ import { dialog , shell } from 'electron' ;
4
5
import log from 'electron-log' ;
5
6
import type { Menubar } from 'menubar' ;
6
7
@@ -35,3 +36,14 @@ export function resetApp(mb: Menubar) {
35
36
mb . app . quit ( ) ;
36
37
}
37
38
}
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