talker 4.5.2 copy "talker: ^4.5.2" to clipboard
talker: ^4.5.2 copied to clipboard

Advanced error handler and logger package for flutter and dart. App monitoring, logs history, report sharing, custom logs, and etc.

example/talker_example.dart

import 'package:talker/talker.dart';

Future<void> main() async {
  final talker = Talker(
    settings: TalkerSettings(
      colors: {
        TalkerLogType.info.key: AnsiPen()..magenta(),
        YourCustomLog.logKey: AnsiPen()..green(),
      },
      titles: {
        TalkerLogType.exception.key: 'Whatever you want',
        TalkerLogType.error.key: 'E',
        TalkerLogType.info.key: 'i',
        YourCustomLog.logKey: 'Custom',
      },
    ),
  );

  /// Logs with LogLevel
  // talker.warning('The pizza is over 😥');
  // talker.debug('Thinking about order new one 🤔');
  talker.error('The restaurant is closed ❌');
  talker.info('Ordering from other restaurant...');
  // talker.verbose('Payment started...');
  // talker.info('Payment completed! Waiting for pizza 🍕');

  /// [Exception]'s and [Error]'s handling
  try {
    throw Exception('Something went wrong');
  } catch (e, st) {
    talker.handle(e, st, 'Exception with');
  }

  /// Custom logs
  talker.logCustom(YourCustomLog('Something like your own service message'));
}

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

  /// Your own log key (for color customization in settings)
  static const logKey = 'custom_log_key';

  @override
  String? get key => logKey;
}
585
likes
160
points
155k
downloads

Publisher

verified publisherfrezycode.com

Weekly Downloads

Advanced error handler and logger package for flutter and dart. App monitoring, logs history, report sharing, custom logs, and etc.

Repository (GitHub)
View/report issues
Contributing

Topics

#logging #error #exception #tool

Documentation

API reference

License

MIT (license)

Dependencies

talker_logger

More

Packages that depend on talker