Any way to hook onto every Ion request on a global level? -


i'm using ion async http library android , i'd custom logging. ideal hook onto every reqest start , end in order total request time , other meta data http response code , url. know of way this?

i'm experimenting setasynchttprequestfactory, seems allow hook onto request begin, not end.

    ion.config ionconf = ion.getdefault(appcontext).configure();     final asynchttprequestfactory reqfac = ionconf.getasynchttprequestfactory();     ionconf.setasynchttprequestfactory((uri, method, headers) -> {         // custom logging stuff here         asynchttprequest req = reqfac.createasynchttprequest(uri, method, headers);         return req;     }); 

implement , add asynchttpclientmiddleware (inherit simplemiddleware) , inject asynchttpclient's pipeline. override onrequest , onresponsecompleted events start , end of request.

or, if enable ion logging globally, can see request time, , sorts of metadata in adb logcat.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -