禁用Android应用程序排球日志 [英] Disable Volley logs in Android application

查看:132
本文介绍了禁用Android应用程序排球日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个SDK使用凌​​空库的HTTP(S)要求。

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

我可以使用自定义日志类包装来掩盖自己的应用程序日志,我想禁用排球的每一个日志级别的印刷,因为它可能暴露敏感发送的HTTPS信息。

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.

我知道你可以使用 ProGuard的禁用应用程序的日志记录,但我也希望能够切换记录从服务器端和关闭调试特定的场景。

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.

我接过一看来源,似乎<一href="https://github.com/google/iosched/blob/master/third_party/volley/src/com/android/volley/VolleyLog.java"相对=nofollow>调试标志在VolleyLog 类只更改日志级别,但保持错误在日志中调用,所以它不是一个解决方案对我来说。

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 ?

推荐答案

我有同样的问题,最后一些谷歌搜索后,我发现,是为我工作的解决方案

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

    VolleyLog.DEBUG = false;

如果您设置 DEBUG 属性您排球日志是禁用的。

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

这篇关于禁用Android应用程序排球日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆