magillus / flutter-fimber

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

Fimber.d not work when use in Isolates #59

Closed trietbui85 closed 4 years ago

trietbui85 commented 4 years ago

I try to use Fimber.d() in an Isolates and notice it doesn't print any log. Version: fimber: ^0.3.2. As I now, Fimber isn't Dart plugin, so do you know why it doesn't work in Isolates?

magillus commented 4 years ago

Thank you for writing about this, I didn't run into it yet - since my usage of Isolates is minimal.

I believe that on each Isolate you need to "plan a tree" That is because they are separate and they do not share memory. That is why your plantTree on first (lets call it main) Isolate is not available on second.

Create a common static method that setups logging trees and execute that on start of the new Isolate.

magillus commented 4 years ago

@anticafe I hope that answered your question - please reopen and comment if not and provide some more details.