Closed Feichtmeier closed 3 months ago
Hi Frederik!
Debug messages may be unwanted or even annoying in released applications. I found the following way to fix the issue:
void main() {
if(kReleaseMode) {
debugPrint = (String? message, {int? wrapWidth}) {};
}
runApp(const MyApp());
}
It works for the whole application and doesn't require to change all the files where debugPrint()
is used.
Hi Frederik!
Debug messages may be unwanted or even annoying in released applications. I found the following way to fix the issue:
void main() { if(kReleaseMode) { debugPrint = (String? message, {int? wrapWidth}) {}; } runApp(const MyApp()); }
It works for the whole application and doesn't require to change all the files where
debugPrint()
is used.
Thanks for your answer!
While this approach works it requires maybe too much of users of your lib. I think the default behaviour should not be to print everything to the terminal. Especially since i/o negatively impacts performance (a bit)
I think I replace debugPrint()
with log()
from dart:developer
.
I think I replace
debugPrint()
withlog()
fromdart:developer
.
sounds nice, I close my PR then and keep the fork until then because I want to use your lib :)
Closed due to changes made in https://github.com/bdrazhzhov/audio-service-mpris/commit/e0402529d09b727776860947437333422b6476ee.
Hi :wave: Thanks for this library! Currently thinking to switch to it for linux for musicpod
I noticed that here https://github.com/bdrazhzhov/audio-service-mpris/blob/master/lib/audio_service_mpris.dart#L34 many debugPrints happen
very unintuive but those also happen in release mode https://api.flutter.dev/flutter/foundation/debugPrint.html
to avoid this you need to check for kDebugMode