dear_diary icon indicating copy to clipboard operation
dear_diary copied to clipboard

Add Dio LogInterceptor

Open ghedwards opened this issue 4 years ago • 5 comments

ghedwards avatar Dec 05 '19 23:12 ghedwards

May i sugest the use of Alice? It has it's own interceptors that you can add to Dio

rodrigobastosv avatar Dec 06 '19 13:12 rodrigobastosv

Alice seems unnecessary for basic logging, LogInterceptor ships with Dio ?

ghedwards avatar Dec 08 '19 21:12 ghedwards

Yes, in the meantime if this is just what we want to log, Alice would appear as an "overkill".

Alameen688 avatar Dec 10 '19 06:12 Alameen688

@ghedwards IMO LogInterceptor should be used to print logs in development just like you would use a print statement. We might not want to add it as part of the code that will be used to generate a release build unless we were logging to an external service or file. That might also not be needed considering the fact that the API already provides logs and if anything fails one can always check the REST API for that (in release build/prod). What do you think?

Alameen688 avatar Dec 10 '19 10:12 Alameen688

You can always use the kReleaseMode to check if it's prod build or not. That would be great because in the tree shaking part of the compilation that code would not be compiled when release build

rodrigobastosv avatar Dec 10 '19 10:12 rodrigobastosv