Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Replace debugPrint with Logger to prevent leaking file paths in production

Amrithesh Kakkoth Ente973d721b1b00
diff --git a/mobile/apps/photos/lib/ui/viewer/file/inline_text_detection.dart b/mobile/apps/photos/lib/ui/viewer/file/inline_text_detection.dart
index fc75e362fd..917c9374ac 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/inline_text_detection.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/inline_text_detection.dart
@@ -99,8 +99,8 @@ class _InlineTextDetectionState extends State<InlineTextDetection> {
Future<void> _evaluateFile() async {
final bool isEligible = _isFileEligible(widget.file);
final int requestId = ++_requestId;
- debugPrint(
- "[InlineTextDetection] evaluateFile: eligible=$isEligible, type=${widget.file.fileType}",
+ _logger.info(
+ "evaluateFile: eligible=$isEligible, type=${widget.file.fileType}",
);
if (!isEligible) {
@@ -138,13 +138,13 @@ class _InlineTextDetectionState extends State<InlineTextDetection> {
}
// Run fast hasText() check
- debugPrint("[InlineTextDetection] running hasText on ${localFile.path}");
+ _logger.info("running hasText check");
bool hasText = false;
try {
hasText = await _mobileOcr.hasText(imagePath: localFile.path);
- debugPrint("[InlineTextDetection] hasText result: $hasText");
+ _logger.info("hasText result: $hasText");
} catch (error, stackTrace) {
- debugPrint("[InlineTextDetection] hasText error: $error");
+ _logger.warning("hasText error: $error");
_logger.severe("Failed to run hasText", error, stackTrace);
}