This repository was archived by the owner on Jul 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
feat: improve logging #342
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Print the messages to stdout and the log file. Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
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š <oss@bajtos.net>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
bajtos
commented
Dec 14, 2022
| const electronLog = require('electron-log') | ||
| const path = require('node:path') | ||
|
|
||
| console.log('Log file:', electronLog.transports.file.findLogPath()) |
Member
Author
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!
bajtos
commented
Dec 14, 2022
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
f3d8350 to
f04baca
Compare
juliangruber
approved these changes
Dec 16, 2022
Member
juliangruber
left a comment
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!
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.