talker 2.0.0+1 copy "talker: ^2.0.0+1" to clipboard
talker: ^2.0.0+1 copied to clipboard

outdated

Advanced error handler and logger package for flutter and dart apps

example/talker_example.dart

import 'package:talker/talker.dart';

Future<void> main() async {
  final talker = Talker(
    settings: TalkerSettings(),
  );

  try {
    throw Exception('Test service exception');
  } catch (e, st) {
    talker.handle(e, st, 'Working with string error');
  }

  try {
    throw Exception('Service can`t get test data');
  } on Exception catch (e, st) {
    talker.handleException(e, st, 'Working with strings exception');
  }

  talker.log(
    'Server error',
    logLevel: LogLevel.critical,
  );

  talker.fine('Log fine');
  talker.error('Log error');
  talker.good('Log good');
  talker.verbose('Log verbose');
  talker.warning('Log warning');
  talker.critical('Log critical');

  final httpLog = HttpTalkerLog('Http good');
  talker.logTyped(httpLog);
}

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

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

  @override
  String generateTextMessage() {
    return pen.write(message);
  }
}
573
likes
0
pub points
96%
popularity

Publisher

verified publisherfrezycode.com

Advanced error handler and logger package for flutter and dart apps

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

talker_logger

More

Packages that depend on talker