shekohex / flutterust

Flutter + Rust = :heart:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to debug rust code in flutter applicaton

myway7 opened this issue · comments

Hello,I don't know How to debug rust code in flutter applicaton,have you a good idea?[呲牙]

well, that depends on how you define the term "debugging" here? are you referring to setting breakpoints in the code and then debug using this? or you referring to it by using logging messages to see what the code is doing?

well, the first one is a bit harder, I don't know if is even possible.

the second one where you could use logging from the Rust side would get logged into the debugging console, that way we use it a lot see frustylogger as an example here and we are using it here in Sunscreen see: https://github.com/sunshine-protocol/sunscreen/blob/d9931d1c56a78ef5c3885e6091d354b541f49774/native/sunshine/src/lib.rs#L5-L12
and here for the Dart side: https://github.com/sunshine-protocol/sunscreen/blob/d9931d1c56a78ef5c3885e6091d354b541f49774/packages/sunshine/lib/sunshine_client.dart#L25

then from your rust side, you could use the log crate as you would normally do and you should see your debugging logs inside the debugging console/terminal in your editor.

Sorry i don't make it clear,I want to know the second,thank you