Skip to content

Commit dd145cd

Browse files
authored
Merge pull request #209 from njhale/fix/log-rotation
fix: pass correct type in rotation logic
2 parents ac04ff0 + 8d9c154 commit dd145cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

electron/config.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ Object.assign(log.transports.file, {
4646
return join(logsDir, `${variables.appName}.log`);
4747
},
4848
archiveLogFn: (file) => {
49-
// Get the current Unix timestamp
50-
const info = parse(file.toString());
49+
const filePath = file.toString();
50+
const info = parse(filePath);
5151
const timestamp = Math.floor(Date.now() / 1000);
5252

5353
try {
54-
renameSync(file, join(info.dir, `${info.name}.${timestamp}.${info.ext}`));
54+
renameSync(filePath, join(info.dir, `${info.name}.${timestamp}${info.ext}`));
5555
} catch (e) {
5656
console.warn('failed to rotate log file', e);
5757
}

0 commit comments

Comments
 (0)