Closed sarthakydv closed 1 year ago
Have you tried using either Logger.addOutputListener
or Logger.addLogListener
instead of a separate printer?
Both should provide you with the necessary information, the only difference is that the LogListener is always being called and OutputListener only if the event successfully passed the LogFilter.
Small sidenote: The LogPrinter
shouldn't decide whether it logs or not, a LogFilter
should be used to determine this.
We were using an older version (1.1.0) of the library
#133 fix added in v1.2.0 paved the way for us to write our own LogOutput
and handle it.
I am thinking of making a demo project since it comes bundled with the crashlytics dependence.
Please let me know how to integrate these changes in the package/demo project as logging to crashlytics must be something many teams are looking for.
Sorry, but you kinda lost me here. Which version are you using now? 1.1.0 or newer?
If you already use 1.2.0 or higher, you should be able to achieve all this in your custom LogOutput without any workarounds.
1.2.0 and higher already expose the original LogEvent (with all your needed information) via OutputEvent.origin
.
Yes yes, that is what we are doing now. I am thinking of adding an example for others to be able to do it like how it was planned in #133.
Just to confirm, the issue is resolved on our end, I am looking to contribute to the project.
Oh, ok, nice, then I am going to go ahead and close this issue as resolved.
Yeah sure, however I thought that the old example in the PR would be enough to give people an idea on how to implement this, but I am certainly not against a real example which showcases the current API!
In our apps, we are catching lots of exceptions but in some cases, it would be good to have them reported back to us. I am currently integrating crashlytics into it.
I made a
CrashlyticsLogPrinter
that along with a few extra changes can work but I would still be returning an empty list. Please suggest alternatives to this approch. I am thinking that a customLogOutput
might help but it works on a line by line basis, I am not sure how I can use it to write a proper log on crashlytics.Any advice will be deeply appreciated