-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Remove auto flush #47
base: main
Are you sure you want to change the base?
Conversation
My only concern with this is missing telemetry when the app crashes. From my understanding Does OnSleep always gets called even if the app crashes? If not it would be best to add a call to Is there any other situations where the app can be killed and OnSleep not triggered? (not used/ looked into the event much before) Personally i havnt seen any performance issues using this, so not sure if this is preemptive optimising with little evidence, that could potentially cause issues |
That is the reason I added flush everywhere from the beginning. Sleep will not be called when the app crash, at lest you cannot trust it to be called. I have tried to add Flush in the HandleCrash method, and it seems to work. But I will do more testing before (if I do) I merge this PR. |
Thank you, @dhindrik for addressing my second point. If Internet connection is not strong and unstable, passing the logging data too frequently to the cloud might be a burden for the app performance. to make sure all types of unhandled exceptions are handled, you need to subscribe for AppDomain.UnhandledException and TaskScheduler.UnobservedTaskException. You can run the flush right from these event handlers, it should guarantee no telemetry data is missed Also, if in doubt, and want to make the Flash timing configurable per client app preference, you can wrap it with some configuration flag check, but even if you have it flashed immediately, flashing it manually under these 2 events are still recommended. As an example, that's how it's done in my app MauiProgram class
Extensions class
|
No description provided.