Detailed debug logs with Volley

前端 未结 5 1070
悲哀的现实
悲哀的现实 2020-12-03 14:08

In Restkit on iOS there is a verbose debug option. RKLogConfigureByName(\"*\", RKLogLevelTrace);. Does anyone know if there is an equivalent for Volley. Basical

5条回答
  •  北海茫月
    2020-12-03 14:41

    Use

    VolleyLog.v("TAG", "Message"); 
    

    for verbose debug option.

    And to get other details you will have to try various options available with error object. Do CTRL + SPACE and go on a trial and error tour. :)

    For example,

    error.networkResponse.statusCode
    

    will give the error code like 404 for page not found.

    And, we can also use various Error Classes provided by Volley to check the type of error using

     if(error instanceOf TimeoutError ){
        // you got timed out  
     }
    

    More details here. Have fun and Welcome to Android :)

提交回复
热议问题