mirror of
https://github.com/linagora/tmail-flutter.git
synced 2026-12-06 16:04:20 +00:00
webConsoleEnabled was deprecated in favour of a global constructor flag, but that removed the ability to force specific log calls visible on web in release/profile mode — a legitimate need for auth and Sentry init diagnostics. Carry webConsoleEnabled through the full pipeline: LogRecord → buildLogRecord → _dispatch → public log functions. ConsoleLogHandler reads the flag from the record rather than from its constructor, so per-call opt-in works independently of build mode. On web: - handles() always returns true (filter deferred to handle()) - handle() prints only when record.webConsoleEnabled || isDebugMode Existing call sites (authorization_interceptors, sentry_config) that pass webConsoleEnabled: true are preserved and functional again.
25 lines
863 B
Dart
25 lines
863 B
Dart
import 'package:core/utils/config/env_loader.dart';
|
|
import 'package:core/utils/logging/formatters/web_console_formatter.dart';
|
|
import 'package:core/utils/sentry/sentry_manager.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:sentry_flutter/sentry_flutter.dart';
|
|
import 'package:tmail_ui_user/main.dart';
|
|
import 'package:tmail_ui_user/main/main_entry.dart';
|
|
import 'package:tmail_ui_user/main/runner/app_runner_base.dart';
|
|
|
|
Future<void> runAppWithMonitoring(Future<void> Function() runTmail) async {
|
|
registerLogHandlers(formatter: const WebConsoleFormatter());
|
|
|
|
await runAppGuarded(() async {
|
|
await EnvLoader.loadEnvFile();
|
|
|
|
await SentryManager.instance.initialize(
|
|
appRunner: () async {
|
|
await runTmailPreload();
|
|
runApp(SentryWidget(child: const TMailApp()));
|
|
},
|
|
fallBackRunner: runTmail,
|
|
);
|
|
});
|
|
}
|