refactor(core,logger)migrate to CherryPickObserver API and drop CherryPickLogger

BREAKING CHANGE:
- Removed the deprecated CherryPickLogger interface from cherrypick
- Logger/adapters (e.g., talker_cherrypick_logger) must now implement CherryPickObserver
- talker_cherrypick_logger: replace TalkerCherryPickLogger with TalkerCherryPickObserver
- All usages, docs, tests migrated to observer API
- Improved test mocks and integration tests for observer pattern
- Removed obsolete files: cherrypick/src/logger.dart, talker_cherrypick_logger/src/talker_cherrypick_logger.dart
- Updated README and example usages for new CherryPickObserver model

This refactor introduces a unified observer pattern (CherryPickObserver) to handle all DI lifecycle events, replacing the limited info/warn/error logger pattern.
All external logging adapters and integrations must migrate to use CherryPickObserver.
This commit is contained in:
Sergey Penkovsky
2025-08-11 18:01:21 +03:00
parent 4dc9e269cd
commit efed72cc39
24 changed files with 507 additions and 436 deletions

View File

@@ -3,11 +3,11 @@ import 'package:talker/talker.dart';
void main() {
final talker = Talker();
final logger = TalkerCherryPickLogger(talker);
final logger = TalkerCherryPickObserver(talker);
logger.info('Hello from CherryPickLogger!');
logger.warn('Something might be wrong...');
logger.error('Oops! An error occurred', Exception('Test error'));
logger.onDiagnostic('Hello from CherryPickLogger!');
logger.onWarning('Something might be wrong...');
logger.onError('Oops! An error occurred', Exception('Test error'), null);
// Вывод всех логов
print('\nВсе сообщения логирования через Talker:');