feat(logging): add talker_dio_logger and talker_bloc_logger integration, improve cherrypick logger structure, add UI log screen for DI and network/bloc debug

This commit is contained in:
Sergey Penkovsky
2025-08-11 16:27:46 +03:00
parent d153ab4255
commit 4dc9e269cd
18 changed files with 523 additions and 55 deletions

View File

@@ -1,18 +1,30 @@
import 'package:cherrypick/cherrypick.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:postly/app.dart';
import 'package:postly/di/core_module.dart';
import 'package:talker_bloc_logger/talker_bloc_logger_observer.dart';
import 'package:talker_flutter/talker_flutter.dart';
import 'di/app_module.dart';
import 'package:talker_cherrypick_logger/talker_cherrypick_logger.dart';
void main() {
final talker = Talker();
final talkerLogger = TalkerCherryPickLogger(talker);
Bloc.observer = TalkerBlocObserver(talker: talker);
CherryPick.setGlobalLogger(talkerLogger);
// Включаем cycle-detection только в debug/test
if (kDebugMode) {
CherryPick.setGlobalLogger(PrintLogger());
CherryPick.enableGlobalCycleDetection();
CherryPick.enableGlobalCrossScopeCycleDetection();
}
// Используем safe root scope для гарантии защиты
CherryPick.openRootScope().installModules([$AppModule()]);
runApp(MyApp());
CherryPick.openRootScope().installModules([CoreModule(talker: talker), $AppModule()]);
runApp(MyApp(talker: talker,));
}