From 49579540fdc4c5c27f95b1b2148a98eedecd18c3 Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Mon, 18 Nov 2024 21:41:25 +0100 Subject: [PATCH] Fix logger after updateConfig Fixes #39 --- lib/core/catcher_2.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/core/catcher_2.dart b/lib/core/catcher_2.dart index 238cfc0..3c3be98 100644 --- a/lib/core/catcher_2.dart +++ b/lib/core/catcher_2.dart @@ -81,6 +81,7 @@ class Catcher2 implements ReportModeAction { _instance = this; _configureNavigatorKey(navigatorKey); _setupCurrentConfig(); + _setupLogger(); _configureLogger(); _setupReportModeActionInReportMode(); _setupScreenshotManager(); @@ -249,12 +250,14 @@ class Catcher2 implements ReportModeAction { } } - void _configureLogger() { + void _setupLogger() { _logger = _currentConfig.logger ?? Catcher2Logger(); if (enableLogger) { _logger.setup(); } + } + void _configureLogger() { for (final handler in _currentConfig.handlers) { handler.logger = _logger; }