refactor: print() durch debugPrint() ersetzen (avoid_print Lint)
65 flutter-analyze-Meldungen behoben, indem alle print()-Aufrufe in Core- Dateien (Push, LiveKit, Matrix-Client, VoIP, Screen-Share) durch das Flutter-eigene debugPrint() ersetzt wurden. Gleiche Funktion (Logging in Debug-Sessions), aber zeilenlängen-sicher und ohne Lint-Warnung. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
// ignore_for_file: avoid_print
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
@@ -119,7 +118,7 @@ class LiveKitCallManager with ChangeNotifier {
|
||||
}
|
||||
await client.setRoomStateWithKey(roomId, _kVoicePresenceType, userId, content);
|
||||
} catch (e) {
|
||||
print('[VoicePresence] $e');
|
||||
debugPrint('[VoicePresence] $e');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +184,7 @@ class LiveKitCallManager with ChangeNotifier {
|
||||
.toList(),
|
||||
);
|
||||
} catch (e) {
|
||||
print('[LiveKit] ICE server fetch error: $e');
|
||||
debugPrint('[LiveKit] ICE server fetch error: $e');
|
||||
}
|
||||
|
||||
await room.connect(
|
||||
@@ -252,7 +251,7 @@ class LiveKitCallManager with ChangeNotifier {
|
||||
final devices = await rtc.navigator.mediaDevices.enumerateDevices();
|
||||
deviceIds = devices.map((d) => d.deviceId).toSet();
|
||||
} catch (e) {
|
||||
print('[LiveKit] Device prefs/enumerate error: $e');
|
||||
debugPrint('[LiveKit] Device prefs/enumerate error: $e');
|
||||
}
|
||||
if (prefMic != null && !deviceIds.contains(prefMic)) prefMic = null;
|
||||
if (prefSpeaker != null && !deviceIds.contains(prefSpeaker)) prefSpeaker = null;
|
||||
@@ -268,7 +267,7 @@ class LiveKitCallManager with ChangeNotifier {
|
||||
try {
|
||||
await rtc.Helper.selectAudioOutput(prefSpeaker);
|
||||
} catch (e) {
|
||||
print('[LiveKit] selectAudioOutput error: $e');
|
||||
debugPrint('[LiveKit] selectAudioOutput error: $e');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,13 +281,13 @@ class LiveKitCallManager with ChangeNotifier {
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
print('[LiveKit] Failed to enable camera: $e');
|
||||
debugPrint('[LiveKit] Failed to enable camera: $e');
|
||||
}
|
||||
}
|
||||
|
||||
_startStatsLogging();
|
||||
} catch (e) {
|
||||
print('[VOIP] Start call error: $e');
|
||||
debugPrint('[VOIP] Start call error: $e');
|
||||
isConnecting = false;
|
||||
error = e.toString();
|
||||
_cleanUpAfterDisconnect();
|
||||
@@ -325,7 +324,7 @@ class LiveKitCallManager with ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<void> setSubscribeQuality(String key) async {
|
||||
print('[LiveKit] Viewer changing subscribe quality to: $key');
|
||||
debugPrint('[LiveKit] Viewer changing subscribe quality to: $key');
|
||||
_subscribeQualityKey = key;
|
||||
if (_room == null) { notifyListeners(); return; }
|
||||
|
||||
@@ -333,7 +332,7 @@ class LiveKitCallManager with ChangeNotifier {
|
||||
for (final p in _room!.remoteParticipants.values) {
|
||||
for (final pub in p.videoTrackPublications) {
|
||||
if (pub.kind == TrackType.VIDEO) {
|
||||
print('[LiveKit] Setting subscription quality for ${p.identity} to $quality');
|
||||
debugPrint('[LiveKit] Setting subscription quality for ${p.identity} to $quality');
|
||||
pub.setVideoQuality(quality);
|
||||
}
|
||||
}
|
||||
@@ -387,13 +386,13 @@ class LiveKitCallManager with ChangeNotifier {
|
||||
);
|
||||
isCameraOff = false;
|
||||
} catch (e) {
|
||||
print('[LiveKit] toggleCamera ON error: $e');
|
||||
debugPrint('[LiveKit] toggleCamera ON error: $e');
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
await _room?.localParticipant?.setCameraEnabled(false);
|
||||
} catch (e) {
|
||||
print('[LiveKit] toggleCamera OFF error: $e');
|
||||
debugPrint('[LiveKit] toggleCamera OFF error: $e');
|
||||
}
|
||||
isCameraOff = true;
|
||||
}
|
||||
@@ -417,7 +416,7 @@ class LiveKitCallManager with ChangeNotifier {
|
||||
isScreenSharing = true;
|
||||
notifyListeners();
|
||||
} catch (e) {
|
||||
print('[ScreenShare] Toggle error: $e');
|
||||
debugPrint('[ScreenShare] Toggle error: $e');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -455,7 +454,7 @@ class LiveKitCallManager with ChangeNotifier {
|
||||
notifyListeners();
|
||||
unawaited(_applyFpsToAllSimulcastLayers(track));
|
||||
} catch (e) {
|
||||
print('[ScreenShare] ERROR: $e');
|
||||
debugPrint('[ScreenShare] ERROR: $e');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -531,7 +530,7 @@ class LiveKitCallManager with ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<void> changeQuality(String qualityKey) async {
|
||||
print('[LiveKit] Streamer changing publish quality to: $qualityKey');
|
||||
debugPrint('[LiveKit] Streamer changing publish quality to: $qualityKey');
|
||||
_localQualityKey = qualityKey;
|
||||
final params = qualityPresets[qualityKey];
|
||||
if (params == null) { notifyListeners(); return; }
|
||||
@@ -549,7 +548,7 @@ class LiveKitCallManager with ChangeNotifier {
|
||||
cameraCaptureOptions: CameraCaptureOptions(params: params),
|
||||
);
|
||||
} catch (e) {
|
||||
print('[LiveKit] Camera restart error: $e');
|
||||
debugPrint('[LiveKit] Camera restart error: $e');
|
||||
isCameraOff = true;
|
||||
}
|
||||
}
|
||||
@@ -573,7 +572,7 @@ class LiveKitCallManager with ChangeNotifier {
|
||||
}
|
||||
await participant.publishAudioTrack(track);
|
||||
if (isMuted) await participant.setMicrophoneEnabled(false);
|
||||
} catch (e) { print('[Audio] error: $e'); }
|
||||
} catch (e) { debugPrint('[Audio] error: $e'); }
|
||||
}
|
||||
|
||||
void setRemoteVolume(double volume) {
|
||||
@@ -599,6 +598,6 @@ class LiveKitCallManager with ChangeNotifier {
|
||||
Future<void> _logStats() async {
|
||||
if (_room == null) return;
|
||||
// Basic stats logging...
|
||||
print('[Stats] SubQuality: $_subscribeQualityKey | PubQuality: $_localQualityKey');
|
||||
debugPrint('[Stats] SubQuality: $_subscribeQualityKey | PubQuality: $_localQualityKey');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user