Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions electron/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ Object.assign(log.transports.file, {
return join(logsDir, `${variables.appName}.log`);
},
archiveLogFn: (file) => {
// Get the current Unix timestamp
const info = parse(file.toString());
const filePath = file.toString();
const info = parse(filePath);
const timestamp = Math.floor(Date.now() / 1000);

try {
renameSync(file, join(info.dir, `${info.name}.${timestamp}.${info.ext}`));
renameSync(filePath, join(info.dir, `${info.name}.${timestamp}${info.ext}`));
} catch (e) {
console.warn('failed to rotate log file', e);
}
Expand Down