Closed cyryl1972 closed 1 year ago
Hi, yes this is normal and intended.
The reason behind this behavior is the default DevelopmentFilter
, as it always returns false when asserts are not enabled.
The intention behind this was probably to prevent logging in production environments, for example, in Flutter asserts are only run during debug mode and this filter reduces the performance impact from logging while running the app in release mode on a real device where logs usually aren't accessible anyway.
However, you can change that behavior by using your own filter or the ProductionFilter
, which always checks the level even without asserts.
Hope this answers your questions :)
hi,
Sorry for my late answer. I understand the concept behind the scene.
You perfectly answered to my question. Have a good day.
When I ran example "example/main.dart":
dart ./example/main.dart -> no message are printed on screen (messages are printed in debug console)
dart --enable-asserts ./example/main.dart -> messages are printed on screen
Can you explain me why? is that behaviour normal?