Advanced error handler and logger for dart and flutter apps ☎️

Log your app actions, catch and handle exceptions and errors, show alerts and share log reports
Show some ❀️ and star the repo to support the project!

codecov Star on Github License: MIT talker talker_flutter talker_logger

Motivation

πŸš€  The main goal of the project provide ability to understand where the error occurs in a short time
βœ…  Can work with different state managments
βœ…  Can work with any crash reporting tool (Firebase Crashlytics, Sentry, Your own, etc)
βœ…  Flutter app logs UI output at screen
βœ…  Integrated logs and excetions history
βœ…  Showing UI exeption alerts

Packages

Talker is designed for any level of customization.

Package Version Description
talker Pub Main dart package for make logs handle exceptions.
talker_flutter Pub Error handler and logger for Flutter applications
talker_logger Pub Pretty logger for dart/flutter apps

Get Started

Follow these steps to the coolest experience in error handling

Add dependency

dependencies:
  talker: ^1.3.0

Easy to use

You can use Talker instance everywhere in your app
Simple and concise syntax will help you with this

final talker = Talker();
// Handle exceptions and errors
try {
  // your code...
} on Exception catch (e, st) {
    talker.handle(e, st, 'Exception with');
}

// Log your app info
talker.info('App is started');
talker.critical('❌ Houston, we have a problem!');
talker.error('🚨 The service is not available');

More examples you can get here

Customization

Configure the error handler and logger for yourself

final talker = Talker(
    /// Your own observers to handle errors's exception's and log's
    /// like Crashlytics or Sentry observer
    observers: [],
    settings: const TalkerSettings(
      /// You can enable/disable all talker processes with this field
      enabled: true,
      /// You can enable/disable saving logs data in history
      useHistory: true,
      /// Length of history that saving logs data
      maxHistoryItems: 100,
      /// You can enable/disable console logs
      useConsoleLogs: true,
    ),
    /// Setup your implementation of logger
    logger: TalkerLogger(),
    ///etc...
  );

More examples you can get here

Talker Flutter

Often you need to check what happening in the application when there is no console at hand.
There is a talker_flutter package for this situations.

Get Started with talker_flutter

Follow these steps to implement talker_flutter in your application

Add dependency

dependencies:
  talker_flutter: ^1.6.0

❗️ Attention ❗️

Latest Flutter stable release have print method bug issues/110236
But with Talker you can solve it with passing your own output/print method

If you want to see full logs in console - pass debugPrint as ouput callback method in Talker constructor

final talker = Talker(
  loggerOutput: debugPrint,
);

Easy to use

You can use TalkerScreen everywhere in your app At Screen, BottomSheet, ModalDialog, etc...

final talker = Talker(
  loggerOutput: debugPrint,
);

Navigator.of(context).push(
  MaterialPageRoute(
    builder: (context) => TalkerScreen(talker: talker),
  )
);

TalkerScreen usage example

TalkerWrapper

In addition to the above,
talker_flutter is able to show default and custom error messages and another status messages

final talker = Talker(
  loggerOutput: debugPrint,
);

TalkerWrapper(
  talker: talker,
  options: const TalkerWrapperOptions(
    enableErrorAlerts: true,
  ),
  child: /// Application or the screen where you need to show messages
),

In order to understand in more details - you can check this article "Showing Flutter custom error messages"

TalkerWrapper usage example

See full application example with BLoC and navigation here

The talker_flutter package have a lot of another widgets like TalkerBuilder, TalkerListener, etc. You can find all of them in code documentation.

Coverage

Error handling is a very important task
You need to choose carefully if you want to use a package for exceptions handling solution
Therefore, the project is 100% covered by tests

Additional information

The project is under development and ready for your pull-requests and issues πŸ‘
Thank you for support ❀️


Thanks to all contributors of this package


For help getting started with 😍 Flutter, view online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Libraries

talker