magillus / flutter-fimber

Fimber is Flutter logger inspired by Timber (logger API for Android)
106 stars 22 forks source link

Support stacktrace info on web #84

Open matthew-carroll opened 4 years ago

matthew-carroll commented 4 years ago

It looks like the class/method names that I get on Android with Fimber does not work the same way on web. I'd like to be able to log the calling class and method name on web, too.

magillus commented 4 years ago

Thank you for reporting this. I will take a look at this, do you use fimber or flutter_fimber? I might update the latter to packaged plugins.

matthew-carroll commented 4 years ago

I'm fine using either one, though if this is implemented at the fimber level then I assume it would work for any Dart project?

magillus commented 4 years ago

I found reason why on web the index of stacktrace (that fimber takes to get line's and tag for it) is blank. The Web dart code adds 4 steps into the stacktrace. image

I need "smarter" way to detect the caller's place.

Maybe just <fn> is not enough and other callers could be added, but probably that is separate issue

matthew-carroll commented 4 years ago

Does this help? https://pub.dev/packages/stack_trace

magillus commented 4 years ago

It is one way to parse it, I hoped to not get any dependency for this simple logging package. I will review this and its output. But it still would need to have different index of the stack per web or native, which can change every new flutter release version.

Thanks for reminding me about this.