Commit 61a1805 1 parent 8fc890c commit 61a1805 Copy full SHA for 61a1805
File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
import { app } from 'electron' ;
2
+ import path from 'node:path' ;
2
3
import { ScopedLoggerImpl } from '../../common/logger/scoped.logger.js' ;
3
4
import type { Logger } from '../../common/logger/types.js' ;
4
5
import { JsonLogFormatterImpl } from './format/json.formatter.js' ;
@@ -53,14 +54,19 @@ const createConsoleTransportConfig = (): LogTransportConfig => {
53
54
} ;
54
55
55
56
const createFileTransportConfig = ( ) : LogTransportConfig => {
56
- const logsPath = app . getPath ( 'logs' ) ;
57
-
58
57
return {
59
58
transporter : new FileLogTransporterImpl ( {
60
- filePath : logsPath ,
59
+ filePath : getLogFilePath ( ) ,
61
60
append : true ,
62
61
encoding : 'utf8' ,
63
62
formatter : new JsonLogFormatterImpl ( ) ,
64
63
} ) ,
65
64
} ;
66
65
} ;
66
+
67
+ const getLogFilePath = ( ) : string => {
68
+ const appName = app . getName ( ) . toLowerCase ( ) ;
69
+ const logsDir = app . getPath ( 'logs' ) ;
70
+
71
+ return path . join ( logsDir , appName + '.log' ) ;
72
+ } ;
You can’t perform that action at this time.
0 commit comments