Is Dart's built-in log function automatically tree-shaken on release builds?

Viewed 31

I think pretty much everyone experienced in Flutter knows that using print method is discouraged as it will be shipped to release builds. So I decided to changed print to use log (from dart:developer) hoping it'll be automatically be tree-shaken on release builds since it's a development tools. However, I still wonder till this day if that's true or not. Can anyone confirm?

1 Answers

No developer.log() doesn't show in release mode. I have tested it. You can also take a look at debugPrint() from flutter/foundation.dart

Related