talker 3.0.0-dev.12 copy "talker: ^3.0.0-dev.12" to clipboard
talker: ^3.0.0-dev.12 copied to clipboard

Advanced Error Handler, Logger, and App Monitoring with Logs History, Report Sharing, Custom Logs, and More.

example/talker_example.dart

import 'package:talker/talker.dart';

Future<void> main() async {
  final talker = Talker();

  // Handle exceptions and errors
  try {
    throw Exception('Something went wrong');
  } catch (e, st) {
    talker.handle(e, st, 'Exception with');
  }

  // Log your app actions
  talker.info('App is started');
  talker.debug('All services enabled');
  talker.error('❌ Houston, we have a problem!');
}

class HttpExampleTalkerLog extends TalkerLog {
  HttpExampleTalkerLog(String message) : super(message);

  @override
  AnsiPen get pen => AnsiPen()..xterm(49);

  @override
  String generateTextMessage() {
    return pen.write(message);
  }
}

class AnalyticsExampleTalkerLog extends TalkerLog {
  AnalyticsExampleTalkerLog(this.talker) : super('Report');

  final Talker talker;

  @override
  String get title => 'ANALYTICS';

  @override
  AnsiPen get pen => AnsiPen()..xterm(121);

  @override
  String generateTextMessage() {
    final msg = '''
$displayTitleWithTime$message
Registred logs: ${talker.history.length}
Registred symbols: ${talker.history.join().split('').length}''';
    return msg;
  }
}
574
likes
0
pub points
96%
popularity

Publisher

verified publisherfrezycode.com

Advanced Error Handler, Logger, and App Monitoring with Logs History, Report Sharing, Custom Logs, and More.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

talker_logger

More

Packages that depend on talker