Skip to content
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

Define and implement a flow for sending logs to us in case of an error #141

Closed
5 tasks
brafdlog opened this issue Dec 17, 2020 · 5 comments · Fixed by #193
Closed
5 tasks

Define and implement a flow for sending logs to us in case of an error #141

brafdlog opened this issue Dec 17, 2020 · 5 comments · Fixed by #193
Assignees

Comments

@brafdlog
Copy link
Owner

brafdlog commented Dec 17, 2020

A user should be able to send us the logs in case he faces an error.

  • Make the logger write to a file
  • Verify there is a global exception handler that logs exceptions
  • Add to the readme a description of how to send logs (either manual or automatic)
  • Make sure we printing things to the log alongside the UI (scraping events, for example)
  • Make sure we are re-assigning the console.log function, or we linting to not use it and use our custom logger instead.
@baruchiro
Copy link
Collaborator

baruchiro commented Dec 21, 2020

Also

  • Make sure we printing things to the log alongside the UI (scraping events, for example)
  • Make sure we are re-assigning the console.log function, or we linting to not use it and use our custom logger instead.

All those points are to define our developing process.

closing baruchiro/israeli-bank-scrapers-desktop#2

@baruchiro
Copy link
Collaborator

OK, I refreshed my memory about our logging infrastructure.

We have two tools, electron-log and Sentry.
When I'm thinking about logging implementation, I'm very careful about sending all the logs automatically and do whatever we want, because I don't want to accidentally send sensitive information.

For now, the practice is logging to a local file, and I turned off all the auto logging in Sentry, and I'm using it just to manually send us a report (this is not my purpose for the future, it is just a minimal requirement.)

About the logger, we initialize it in the main process, and passing it to the renderer. Because it writes to one file, so it has to be one object.

From that point we just need to update the infra, inject the logger and Sentry in a more convenient way, and with types, and so on.

TYDW?

BTW @brafdlog I need to give you access to Sentry.

@brafdlog
Copy link
Owner Author

Sounds good.

How about overriding console log (https://github.com/megahertz/electron-log#overriding-consolelog) so the code can just use conosle.log and it will work

@baruchiro
Copy link
Collaborator

I remembering this feature, but I didn't use it, maybe it not worked?

Anyway, I thought about that again, and maybe we want to keep it without the console.log. In that way, you can still debug with console.log, but eslint will catch you 8f you accidentally committed a dummy log write.

@baruchiro baruchiro mentioned this issue Jan 2, 2021
3 tasks
@baruchiro
Copy link
Collaborator

Consider using a different logger for background.ts and main.ts, see megahertz/electron-log#244.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants