Files
cherrypick/talker_cherrypick_logger/example/talker_cherrypick_logger_example.dart
Sergey Penkovsky efed72cc39 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.
2025-08-12 00:29:41 +03:00

18 lines
628 B
Dart
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:talker_cherrypick_logger/talker_cherrypick_logger.dart';
import 'package:talker/talker.dart';
void main() {
final talker = Talker();
final logger = TalkerCherryPickObserver(talker);
logger.onDiagnostic('Hello from CherryPickLogger!');
logger.onWarning('Something might be wrong...');
logger.onError('Oops! An error occurred', Exception('Test error'), null);
// Вывод всех логов
print('\nВсе сообщения логирования через Talker:');
for (final log in talker.history) {
print(log); // Пример, либо log.toString(), либо log.message
}
}