Skip to content

Commit cadda85

Browse files
committed
Remove Error Reporter
1 parent dc50cd8 commit cadda85

File tree

3 files changed

+6
-119
lines changed

3 files changed

+6
-119
lines changed

lib/src/codelessly.dart

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import 'package:http/http.dart';
1111
import '../codelessly_sdk.dart';
1212
import 'logging/debug_logger.dart';
1313
import 'logging/error_logger.dart';
14-
import 'logging/reporter.dart';
1514
import 'utils/codelessly_http_client.dart';
1615

1716
typedef NavigationListener = void Function(
@@ -332,9 +331,7 @@ class Codelessly {
332331
}) {
333332
_config ??= config;
334333

335-
initErrorLogger(
336-
automaticallySendCrashReports: _config!.automaticallySendCrashReports,
337-
);
334+
initErrorLogger();
338335

339336
assert(
340337
status is! CEmpty,
@@ -492,17 +489,11 @@ class Codelessly {
492489
/// initialized. If it is initialized, this is ignored.
493490
///
494491
/// If the SDK is running on web platform, this will be ignored.
495-
void initErrorLogger({
496-
required bool automaticallySendCrashReports,
497-
}) {
492+
void initErrorLogger() {
498493
DebugLogger.instance.printFunction('initErrorLogger()', name: name);
499494
if (_errorLogger != null) return;
500495

501-
_errorLogger = ErrorLogger(
502-
reporter: automaticallySendCrashReports
503-
? FirestoreErrorReporter(_firebaseApp!, _firebaseFirestore!)
504-
: null,
505-
);
496+
_errorLogger = ErrorLogger();
506497
}
507498

508499
/// Initializes this instance of the SDK.
@@ -566,9 +557,7 @@ class Codelessly {
566557

567558
await initFirebase(config: _config!);
568559

569-
initErrorLogger(
570-
automaticallySendCrashReports: _config!.automaticallySendCrashReports,
571-
);
560+
initErrorLogger();
572561

573562
try {
574563
status = CStatus.loading(CLoadingState.initializedFirebase);

lib/src/logging/error_logger.dart

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'dart:async';
22
import 'package:logging/logging.dart';
33

44
import '../logging/debug_logger.dart';
5-
import 'reporter.dart';
65
import 'codelessly_event.dart';
76

87
/// Represents a logged error with context
@@ -36,7 +35,6 @@ class ErrorLogger {
3635
static ErrorLogger get instance => _instance ??= ErrorLogger._();
3736

3837
final List<ErrorLog> _errorLogs = [];
39-
ErrorReporter? _reporter;
4038

4139
final StreamController<ErrorLog> _errorStreamController =
4240
StreamController<ErrorLog>.broadcast();
@@ -46,10 +44,9 @@ class ErrorLogger {
4644

4745
ErrorLogger._();
4846

49-
/// Factory constructor that initializes the singleton instance with a reporter
50-
factory ErrorLogger({ErrorReporter? reporter}) {
47+
/// Factory constructor that initializes the singleton instance
48+
factory ErrorLogger() {
5149
_instance ??= ErrorLogger._();
52-
_instance!._reporter = reporter;
5350
return _instance!;
5451
}
5552

@@ -78,21 +75,15 @@ class ErrorLogger {
7875
name: name,
7976
level: Level.WARNING,
8077
);
81-
82-
if (_reporter != null) {
83-
_reporter!.captureException(error);
84-
}
8578
}
8679

8780
Future<void> captureEvent(CodelesslyEvent event) async {
8881
DebugLogger.instance.printInfo(event.toString(), name: name);
89-
_reporter?.captureEvent(event);
9082
}
9183

9284
void dispose() {
9385
_errorStreamController.close();
9486
_errorLogs.clear();
95-
_reporter = null;
9687
_instance = null;
9788
}
9889

lib/src/logging/reporter.dart

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)