-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable all VolleyLogs #125
Comments
Is there a particular reason you want to do this, or log entry you find spammy? The hope is that our default logging is helpful to users, and I'd rather adjust things that aren't helpful than provide a hook that just turns it all off. But anyway, you can do this with Proguard, which is what I'd recommend as it's more efficient than flagging it off at runtime anyway. Something like:
Please let me know if you are concerned about a particular log message being spammy or if the proguard solution isn't reasonable and we can discuss further. |
Yes getting same issue and it print warning in logcat with URL, So for security purpose we want to disable that warning "A connection to https://abc.xyz.com/ was leaked. Did you forget to close a response body?" is there any other way to disable above warning other than proguard or is there any alternate solution to disable above warning?? |
That error message does not come from Volley. From a quick search it appears to come from OkHttp. |
We have not used OkHttp for network communication, I am using only Volley so is Volley internally used OkHttp? In over all project don't have the OkHttp reference. |
Ah, perhaps it's coming from the Android platform then? Newer platform versions bundle a copy of OkHttp and use it for HttpUrlConnection under the covers. It might help if you share the log tag where that message is logged (i.e. the full line output under "adb logcat"). Anyway, based on the message I suspect what you're seeing is the same issue as #138, just with a different error, and it should be fixed once that is fixed. |
Closing this out as a fix for #138 is out for review, and there's no other evidence of other log messages of concern here. |
error logs still appear when applying this what should I do to disable all logs in the release version? |
|
How would I get this proguard that you speak of.
daedaesplayground
…On Wed, Apr 10, 2019, 6:12 AM basmasrour ***@***.***> wrote:
Is there a particular reason you want to do this, or log entry you find
spammy? The hope is that our default logging is helpful to users, and I'd
rather adjust things that aren't helpful than provide a hook that just
turns it all off.
But anyway, you can do this with Proguard, which is what I'd recommend as
it's more efficient than flagging it off at runtime anyway. Something like:
-assumenosideeffects class com.android.volley.VolleyLog {
public static void v(...);
public static void d(...);
public static void i(...);
public static void w(...);
public static void v(...);
}
Please let me know if you are concerned about a particular log message
being spammy or if the proguard solution isn't reasonable and we can
discuss further.
@jpd236 <https://github.com/jpd236>
please advise it's not working, want to disable logs for the release
version
Thanks.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#125 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AoVbp0tq58HPUuP-QSzqpQCqD8fZuOSnks5vfccHgaJpZM4RAkJO>
.
|
@basmasrour Can you provide a sample app reproducing the issue? What specific log statements do you still see? @daedaesplayground1991 https://developer.android.com/studio/build/shrink-code |
2019-04-10 16:16:31.602 5881-6774/? E/Volley: [103739] BasicNetwork.performRequest: Unexpected response code 500 for my_request_url Or |
That log statement is coming from a call to VolleyLog.e, so it should be covered:
Note that there was a typo previously in my above comment; make sure that your proguard config has the e() method included in it. Otherwise, this is likely an issue with your build and whether proguard is being applied correctly. One thing I'll note is that "BasicNetwork.performRequest" isn't obfuscated, which it would be if you had proguard obfuscation enabled. I'm not sure exactly what proguard flags would otherwise be needed for assumenosideeffects to work as expected, but some level of optimization would need to be enabled. This is more a question for the Android tooling side of things than Volley itself. |
Yes you can see in the first comment I write that I have put the e() function Thank you for your reply, is there a detailed sample let me know if I'm working right with proguard? That will help a lot ... Thanks in advance |
I would recommend a more general support forum for help getting Proguard working - it's not particularly specific to Volley. If you think there's something Volley is doing incorrectly or which would make applying Proguard easier, then please let us know. |
Why you are not checking DEBUG tag in logSlowRequests, you should use DEBUG check in all logs in VolleyLog class. |
DEBUG flag check is just for Log.v() in VolleyRequest 😥 |
That is really frustrating, I have to take all project as a module. They cannot even do a simple DEBUG check. |
Hiding all VolleyLogs by setting VolleyLog.DEBUG to false is not working for all logs. How can we Disable all Logs(Log.e, Log.d etc) from volley. It seems like only the log.v can handle with the VolleyLog.DEBUG key.
The text was updated successfully, but these errors were encountered: