Matthias Nott
2026-03-25 d6cf9469aa0462d1b8313cc85907176eee1214a2
lib/services/mqtt_service.dart
....@@ -5,6 +5,7 @@
55 import 'package:crypto/crypto.dart';
66
77 import 'package:bonsoir/bonsoir.dart';
8
+import 'package:flutter/foundation.dart';
89 import 'package:flutter/widgets.dart';
910 import 'package:path_provider/path_provider.dart' as pp;
1011 import 'package:mqtt_client/mqtt_client.dart';
....@@ -23,8 +24,10 @@
2324 reconnecting,
2425 }
2526
26
-// Debug log to file (survives release builds)
27
+// Debug log — writes to file only in debug builds, always prints via debugPrint
2728 Future<void> _mqttLog(String msg) async {
29
+ debugPrint('[MQTT] $msg');
30
+ if (!kDebugMode) return;
2831 try {
2932 final dir = await pp.getApplicationDocumentsDirectory();
3033 final file = File('${dir.path}/mqtt_debug.log');