Flutter logs

#① - Flutter logs

I know we get to see Flutter logs by default but this is something different. There is also a command to log the output of the running flutter app. It’s called simple ’flutter logs’. Just open the terminal and hit this command.

At this point, you must ask me a question. I am giving you time to think of that question before you read further.

🤔

🤔

🤔

Ok, You give it a thought. Thanks.

The question must be why?? Why we should use this command?

The main advantage of using this command is that you can fire it in multiple terminal windows/tabs in Android studio. This gives us the ability to look back in the history of the log output of the previous app runs 😲

In the very first tab, you hit the ‘flutter logs’ command and run the app. You can see all the log output in the first tab. Then you make some changes(probably print() or debugPrint() statement) and run ‘flutter logs’ in another tab and run the app again. This trick can help you see the state of logs of the previous app run whereas normal logging will always replace old logs with the new ones.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

How to extract filename from Uri?

Now, we can extract filename with and without extension :) You will convert your bitmap to uri and get the real path of your file. Now w...