π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][log] Report msg
Neeraj Guptacac7840f03dc
diff --git a/mobile/apps/photos/lib/core/error-reporting/super_logging.dart b/mobile/apps/photos/lib/core/error-reporting/super_logging.dartindex 90809cebf3..2a8b8ed201 100644--- a/mobile/apps/photos/lib/core/error-reporting/super_logging.dart+++ b/mobile/apps/photos/lib/core/error-reporting/super_logging.dart@@ -272,18 +272,35 @@ class SuperLogging {return result;}+ /// Send an error to sentry, if enabled.+ /// // note: stack is not reported currentlystatic Future<void> _sendErrorToSentry(Object error,- StackTrace? stack,- ) async {+ StackTrace? stack, {+ LogRecord? rec,+ }) async {try {if (_shouldSkipSentry(error)) {return;}- await Sentry.captureException(- error,- stackTrace: stack,- );+ if (rec != null) {+ await Sentry.captureException(+ error,+ stackTrace: stack,+ withScope: (scope) {+ scope.setContexts('log_details', {+ 'message': rec.message,+ });+ scope.setTag('logger', rec.loggerName);+ scope.setTag('level', rec.level.name);+ },+ );+ } else {+ await Sentry.captureException(+ error,+ stackTrace: stack,+ );+ }} catch (e) {$.info('Sending report to sentry failed: $e');$.info('Original error: $error');@@ -306,10 +323,10 @@ class SuperLogging {// write to stdoutprintLog(str);- saveLogString(str, rec.error);+ saveLogString(str, rec.error, rec: rec);}- static void saveLogString(String str, Object? error) {+ static void saveLogString(String str, Object? error, {LogRecord? rec}) {// push to log queueif (fileIsEnabled) {fileQueueEntries.add(str + '\n');@@ -320,7 +337,7 @@ class SuperLogging {// add error to sentry queueif (sentryIsEnabled && error != null) {- _sendErrorToSentry(error, null).ignore();+ _sendErrorToSentry(error, null, rec: rec).ignore();}}