有没有办法使用electon-log在电子应用程序中从console.log记录所有内容?

时间:2018-01-27 11:33:00

标签: node.js electron

我的电子版应用程序的主要流程已经有了大量的console.log语句,有没有办法将所有这些发送到电子日志或其他日志,可以在应用程序打包后访问?我打算通过脚本添加let calendar = Calendar.current var todayStartDate = Date() var interval = TimeInterval() calendar.dateInterval(of: .day, start: &todayStartDate, interval: &interval, for: Date()) let todayEndDate = calendar.date(byAdding: .second, value: Int(interval-1), to: todayStartDate)! print(todayStartDate) print(todayEndDate) ,但希望有更好的方法。

log.error

1 个答案:

答案 0 :(得分:1)

类似的东西:

console.log = function(){
   ...your code...
};

可以是个主意吗?

相关问题