Flutter Tutorial - Log Everything - Smart Logging

preview_player
Показать описание
We build a smart logger for our Flutter apps with which can log everything on different levels.



Resources:

Share this video, write a comment and hit the like button. To never miss anything, subscribe to my Youtube channel (Activate the bell, to never miss upcoming

*********

FOLLOW & VISIT ME on my social media:

If you find this video useful, LIKE & SHARE this video to help other people who also learn Flutter :)

#Flutter #FlutterTutorials #JohannesMilke

Рекомендации по теме
Комментарии
Автор

Hi Johannes! Great video!
I wanted to share that, in case somebody is looking for a simpler solution for something that doesn't need too much control over what's logged, it is possible to get the information of the class invoking the logger without the need of passing it as a parameter using for example:
logger.d('$runtimeType: <YOUR MESSAGE>');

if your class is MyClass, the output will be:
MyClass: YOUR MESSAGE


But when more control over the logs is needed, the solution you proposed is really really good!

tarozzoandrea
Автор

Hi,

Thank you for the video.
Really good job on explaining this concept :)

andiandrei
Автор

Great and very usefull video. In the current flutter version I am getting a waring for the closure:
final logger = (Type type) => Logger( printer:
With the recommendation to Use a function declaration rather than a variable assignment to bind a function to a name.
Try rewriting the closure assignment as a function


What is the best way to make it clean? Thanks

PeterGolemanov
Автор

How can I print the time in the CustomPrinter class?

mojtabahoseini
Автор

Hello Johannes,

can I also save the data locally so that I can view it after a crash of the app? Or better, can I send the locally stored log messages to me in the event of a crash after user consent?

Thanks for the great video, Michael

michi
Автор

realyly realy great work i am an intern and it help me a lot

mosbahhoucemeddine
Автор

To avoid waring. Use below code.

logger(Type className){
return Logger(
printer: CustomLogger(className.toString()),
level: Level.debug,
filter: null, // Use the default LogFilter (-> only log in debug mode)
output: null, // Use the default LogOutput (-> send everything to console)
);
}

iqaiserhussain
Автор

Hi Johannes,

How can I fulfill the hint of the rule? I get the hint: "Use a function declaration to bind a function to a name."

final logger = (Type type) => Logger(
printer: CustomerPrinter(type.toString()),
level: Level.verbose,
);

michi
Автор

Hi, Johannes.
Nice tut.
Can we do remote logging using the same concept?

ibrahimalqayyas