Debugging, DevTools and Profiling

IDE debugging: breakpoints, conditional breakpoints, logpoints, step in/over/out, watch expressions, the debug console (VS Code/IntelliJ).

dart:developer: debugger() (programmatic breakpoint), log('msg', name: 'network'), Timeline.startSync/finishSync, inspect(obj).

Dart DevTools (dart devtools, or opened from the IDE):

Find hot functions (flame charts) Heap snapshots, allocation tracing, leak detection

Timeline events, frame rendering (Flutter) HTTP traffic inspection log() output Breakpoints, the call stack Analyze AOT snapshot size Inspector (Flutter)

Logging packages: logging (Dart team: hierarchical loggers, levels), logger (pretty console output), talker.

Benchmarks: benchmark_harness, Stopwatch.

dart run --observe bin/main.dart            # enable the VM service for DevTools
dart run --pause-isolates-on-start --observe bin/main.dart
dart compile exe bin/main.dart --target-os linux -o app