| .. | .. |
|---|
| 5 | 5 | import 'package:crypto/crypto.dart'; |
|---|
| 6 | 6 | |
|---|
| 7 | 7 | import 'package:bonsoir/bonsoir.dart'; |
|---|
| 8 | +import 'package:flutter/foundation.dart'; |
|---|
| 8 | 9 | import 'package:flutter/widgets.dart'; |
|---|
| 9 | 10 | import 'package:path_provider/path_provider.dart' as pp; |
|---|
| 10 | 11 | import 'package:mqtt_client/mqtt_client.dart'; |
|---|
| .. | .. |
|---|
| 23 | 24 | reconnecting, |
|---|
| 24 | 25 | } |
|---|
| 25 | 26 | |
|---|
| 26 | | -// Debug log to file (survives release builds) |
|---|
| 27 | +// Debug log — writes to file only in debug builds, always prints via debugPrint |
|---|
| 27 | 28 | Future<void> _mqttLog(String msg) async { |
|---|
| 29 | + debugPrint('[MQTT] $msg'); |
|---|
| 30 | + if (!kDebugMode) return; |
|---|
| 28 | 31 | try { |
|---|
| 29 | 32 | final dir = await pp.getApplicationDocumentsDirectory(); |
|---|
| 30 | 33 | final file = File('${dir.path}/mqtt_debug.log'); |
|---|