Enhancement Proposal: Logging #632
Replies: 7 comments 1 reply
-
@millerjp @digiserg @mhmdkrmabd Dear team, I'd like to know your opinion on that. I'd like to give you more time, but resources are limited, and I'll have much less time in January. |
Beta Was this translation helpful? Give feedback.
-
@HadesArchitect I have no issues, it sounds like a good proposal. |
Beta Was this translation helpful? Give feedback.
-
@HadesArchitect Makes sens to me! |
Beta Was this translation helpful? Give feedback.
-
@HadesArchitect thank you for that enrich details! switching to |
Beta Was this translation helpful? Give feedback.
-
Issue created and assigned to @HadesArchitect #634 |
Beta Was this translation helpful? Give feedback.
-
@HadesArchitect Worth to be mentioned here that there's a planned refactoring process after finishing important tickets, we do regular refactoring process after couple of merged PRs, feel free to create a branch and don't worry about how tidy or clear the code is, we'll clean and improve the source code afterwards 👍. |
Beta Was this translation helpful? Give feedback.
-
It was literally my next proposal 😁 Seeing exceptions used as goto
statement makes me cry 😅
вт, 17 дек. 2024 г., 18:47 Mohammed Abed El Hay Abu Baker <
***@***.***>:
… @HadesArchitect <https://github.com/HadesArchitect> Worth to be mentioned
here that there's a planned refactoring process after finishing important
tickets, we do regular refactoring process after couple of merged PRs, feel
free to create a branch and don't worry about how tidy or clear the code
is, we'll clean and improve the source code afterwards 👍.
—
Reply to this email directly, view it on GitHub
<#632 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANJLXJK4JBBB52YQN2RIHL2GBPRZAVCNFSM6AAAAABTW4EKCGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNJZGY2DSNA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
Problem
At the moment, the Workbench uses an in-house logging module. It violates best practices, introduces the need to maintain it on our own and makes the code base more complicated.
Suggestion
We can improve the project extensibility and maintainability by using a standard logging module. I suggest refactoring the Workbench using the Electron logging library electron-log
Rationale
Details
Sample Code
main.js
init.js (renderer)
Output Samples
Considered Alternatives
At the moment, electron-log is the only "electron-aware" logger I'm aware of; all the other solutions will require proper adaptation (e.g., injecting them into renderers and using IPC to deliver logs to the main process), which is definitely not the job we want to do. Theoretically beneficial could be the use of e.g. Winston, which is more powerful and configurable, but it's again not electron-aware, and I doubt we need it configurability.
electron-log Pros and Cons
🟢 De-facto standard solution (130 forks, 1.3 stars), known and maintained
🟢 Electron-aware logger (Native support of renderer processes, no need for direct IPC communication)
🟢 Out-of-the-Box Multi-channel output support (console + file + centralised log storage, if desired)
🟢 Simple replacement/extension for default console.log (no need for custom solution)
🟢 Out-of-the-box capture and logging of internal electron errors/warnings, etc.
🟢 Logging scopes support
🟢 Logs buffering (show minimum if all good, print all logs in case of failure)
🔴 Requires solid refactoring
Action Plan
If stakeholders approve the proposal, I will refactor the code and make a new pull request. If approval is granted quickly, it can be done before Christmas.
Beta Was this translation helpful? Give feedback.
All reactions