Exploring debugging practices and tools
There are many ongoing debates among programmers. One of them is the print statement versus using debuggers debate. Personally, I often dislike this binary choice because, as is often the case with programming, the only real valid answer is “it depends!” Fortunately, Flutter supports both approaches and provides us with some amazing tools. Let’s review them.
Logging – the good, the bad, and the ugly
The logging process is a widely used method to obtain information about the behavior of our app, which is printed into the console. Most programming languages, including Dart, have a method for printing statements to the console. In Dart, this is done by calling the print('Any string here');
method. However, this simple approach has limitations when used in the context of an application. The following issues arise when using the print
function:
- Very long log messages can be truncated, which is especially...