DEV Community

Stanislav Ilin
Stanislav Ilin

Posted on • Edited on

Http logs in Flutter app with talker is easy as possible

A major update of the talker package has recently been released.
New release contains updated TalkerScreen with more actions and logs file sharing, fixed logs generation and etc.

😳 But another one big thing in update is talker_dio_logger package that can integrate http logs as simple as it can ever be done.

Let's take it in turns.

How it will works

talker_dio_logger

talker_dio_logger is a separate package that works on the basis of talker error handler and logger package and dio most popular and powerful dart http client.

When you connect it, all information about your work on the network gets into talker's history and the console of the running application.

Get Started

Follow these steps to run talker_dio_logger in your project and see all http logs

Add dependency

dependencies:
  talker_dio_logger: ^0.1.3
Enter fullscreen mode Exit fullscreen mode

Usage

Just add TalkerDioLogger to your dio instance and it will work

final dio = Dio();
dio.interceptors.add(
    TalkerDioLogger(
        settings: const TalkerDioLoggerSettings(
          printRequestHeaders: true,
          printResponseHeaders: true,
        ),
    ),
);
Enter fullscreen mode Exit fullscreen mode

Using with Talker

You can add your talker instance for TalkerDioLogger if your app already uses Talker.

In this case, all logs and errors will fall into your unified talker tracking system

final talker = Talker();
final dio = Dio();
dio.interceptors.add(
    TalkerDioLogger(
        talker: talker,
        settings: const TalkerDioLoggerSettings(
          printRequestHeaders: true,
          printResponseHeaders: true,
        ),
    ),
);
Enter fullscreen mode Exit fullscreen mode

😎 Go to the GitHub repository page!
🥵 Here you can see beautiful examples of usage and code snippets.

Show some ❤️ and star the repo to support the project!

Top comments (9)

Collapse
 
ashishdedania profile image
Ashish Dedaniya

Very nice explaination

Collapse
 
frezyx profile image
Stanislav Ilin

Thank you a lot

Collapse
 
mnosov622 profile image
Maxim Nosov ✪ • Edited

Hi Stanislav !

I enjoy reading your posts :)
Let's connect ?

My linkedIn

Thank you !

Collapse
 
frezyx profile image
Stanislav Ilin

☺️

Collapse
 
ceresexe profile image
Ceres

Awesome content! ^.^;

Collapse
 
frezyx profile image
Stanislav Ilin

Thank you !

Collapse
 
shyambaral profile image
Shyam Baral

very nice

Collapse
 
jaredm profile image
professorjrod

Great article!! I gotta check out talker.

Collapse
 
frezyx profile image
Stanislav Ilin

Thank you! You can see examples here