feat(log): log autoupdate info
This commit is contained in:
@ -57,7 +57,8 @@ const logFile = fs.createWriteStream(app.getPath("userData") + '/rats.log', {fla
|
||||
const logStdout = process.stdout;
|
||||
|
||||
console.log = (...d) => {
|
||||
logFile.write(util.format(...d) + '\n');
|
||||
const date = (new Date).toLocaleTimeString()
|
||||
logFile.write(`[${date}] ` + util.format(...d) + '\n');
|
||||
logStdout.write(util.format(...d) + '\n');
|
||||
};
|
||||
|
||||
@ -232,6 +233,16 @@ const startSphinx = (callback) => {
|
||||
}
|
||||
}
|
||||
|
||||
// log autoupdate
|
||||
const log = require('electron-log')
|
||||
log.transports.file.level = false;
|
||||
log.transports.console.level = false;
|
||||
log.transports.console = function(msg) {
|
||||
const text = util.format.apply(util, msg.data);
|
||||
console.log(text);
|
||||
};
|
||||
autoUpdater.logger = log;
|
||||
|
||||
autoUpdater.on('update-downloaded', () => {
|
||||
console.log('update-downloaded lats quitAndInstall');
|
||||
if (env.name === "production") {
|
||||
|
Reference in New Issue
Block a user