Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Volley logs in Android application

The problem

I'm developing a SDK with using the Volley library for http(s) calls.

I'm able to hide my application logs using a customize Log class wrapper, and I would like to disable every log level printing of Volley, because it might expose sensitive information sent by HTTPS.

I know you can use proguard to disable logging of application, but I also want to be able to toggle logging on and off from the server side for debugging specific scenarios.

What have I tried

I took a look at the source, and it seems that the DEBUG flag in the VolleyLog class only changes the log level, but keeps ERROR calls in the log, so it isn't a solution for me.

Is it possible to hide all Volley logs ?

like image 252
Gilad Eshkoli Avatar asked Jul 23 '15 09:07

Gilad Eshkoli


People also ask

How do I disable volley cache?

If you have your own implementation of the Request class, then you can call setShouldCache(false) in the constructor of your class. This solution disables caching for each requests individually.

Why do we use Volley Library in Android?

Volley is an HTTP library that makes networking for Android apps easier and most importantly, faster. Volley is available on GitHub. Volley offers the following benefits: Automatic scheduling of network requests.

What is Android Volley Library?

Volley is an HTTP library that makes networking very easy and fast, for Android apps. It was developed by Google and introduced during Google I/O 2013. It was developed because there is an absence in Android SDK, of a networking class capable of working without interfering with the user experience.


1 Answers

I had same issue and finally after some google search i found the solution that is worked for me

    VolleyLog.DEBUG = false;

if you set DEBUG attribute to false you Volley Log is disabled

like image 67
Amin Bahiraee Avatar answered Sep 28 '22 23:09

Amin Bahiraee