flutter-fimber icon indicating copy to clipboard operation
flutter-fimber copied to clipboard

Support stacktrace info on web

Open matthew-carroll opened this issue 5 years ago • 5 comments

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.

matthew-carroll avatar Aug 09 '20 08:08 matthew-carroll

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.

magillus avatar Aug 10 '20 02:08 magillus

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?

matthew-carroll avatar Aug 10 '20 03:08 matthew-carroll

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.

  • find 'log' index on the stacktrace
  • +2 from 'log' index to get the value - in above it would be

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

magillus avatar Aug 11 '20 01:08 magillus

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

matthew-carroll avatar Aug 11 '20 05:08 matthew-carroll

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.

magillus avatar Aug 11 '20 12:08 magillus