使用 Volley 的详细调试日志 [英] Detailed debug logs with Volley
问题描述
在 iOS 上的 Restkit 中,有一个详细的调试选项.RKLogConfigureByName("*", RKLogLevelTrace);
.有谁知道 Volley 是否有等价物.基本上我会直接进入 ErrorListener 但我在 LogCat 中没有得到额外的信息.两者:
In Restkit on iOS there is a verbose debug option. RKLogConfigureByName("*", RKLogLevelTrace);
. Does anyone know if there is an equivalent for Volley. Basically I am going straight to the ErrorListener but I get no additional info in LogCat. Both:
VolleyLog.e("Error: ", error.toString());
还有:
VolleyLog.e("Error: ", error.getMessage());
打印:
2.onErrorResponse: Error:
推荐答案
如果你想从 volley 库中获得详细的 Log,你必须使用 adb
If you want verbose Log from the volley library, you have to use adb
adb -s 42f63b0de7318fe1 shell setprop log.tag.Volley VERBOSE
其中42f63b0de7318fe1
"是您将获得的设备 ID
where "42f63b0de7318fe1
" is your device id which you will get by
adb devices
如果您想保留此设置,请使用
If you want to persist this setting use
adb -s 42f63b0de7318fe1 shell setprop persist.log.tag.Volley VERBOSE
如果您只有 1 个设备,则可以省略 -s
参数
If you have only 1 device you can omit the -s
argument
另见 如何设置eclipse 中的 ADT 系统属性,所以它总是运行
终止并重新启动您的应用以应用设置.
Kill and restart your app to apply the setting.
这篇关于使用 Volley 的详细调试日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!