-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: improve logging #342
Conversation
Print the messages to stdout and the log file. Signed-off-by: Miroslav Bajtoš <[email protected]>
Replace `console.log` with `electron-log`, so that the informational messages are printed both to stdout and the log file. Signed-off-by: Miroslav Bajtoš <[email protected]>
Signed-off-by: Miroslav Bajtoš <[email protected]>
const path = require('node:path') | ||
|
||
console.log('Log file:', electronLog.transports.file.findLogPath()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intention here is to make it easier to locate the electron-log file when troubleshooting problems. I am using console.log
instead of electron-log because it feels redundant to log the filename of the log file into that log file.
Let me know if you thing otherwise!
Rework another console.log in main/station-config.js to call log.info instead. Signed-off-by: Miroslav Bajtoš <[email protected]>
Signed-off-by: Miroslav Bajtoš <[email protected]>
f3d8350
to
f04baca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Example stdout output:
Notice the deprecation warning about
findLogPath()
. The documentation does not explain what we should use instead offindLogPath()
🙁With my changes in place, we can improve our UI for reporting problems and allow users to send their electron-log file, too. Perhaps in addition to the Saturn log file. Or we can change the Saturn Module to log messages using electron-log, so that we have everything in one place. Either way, that's out of scope of my PR.