开发者

Log instead of debug?

A colleague of mine advice me not to debug android applications inst开发者_JS百科ead using Logging in order to see what is going on in application. Is it a common practice?


Eclipse and the Android plug-in/SDK works fine for debugging and show what variable has what value, e.g.

If you have a lot of (complex) data you should log instead.


Logging is common practice, yes.

So is debugging.


Both are good for different purposes.

Debugging is great at implementation time when you plow through functionalities, add them and test one-by-one in lab environment....

Logging is especially useful, when you do not have the device with you, connected through USB and run under adb debugger or where you want to debug dynamic situations that you should not stop in the middle by breakpoints.

In android fragmented world, logging is so much needed - because you are not able to run your application on so many different devices - you usually have to get some testers or beta users to use your application remotely ... and there debugging is no-op.. In this case you might want to get those guys to send you logs collected with aLogcat or get a bit more professional solution (like http://apphance.com) to browse the logs remotely.

Disclaimer: I am co-creator of Apphance and CTO of the company which created it - Polidea: http://www.polidea.pl.


It depends on situation. Sometimes it's impossible or really hard to debug application. E.g. for multithreaded applications or applications with some time limits or so, some real devices also dislike debugging. In this case only option is logging. Anyway good developer should be able both work with debugging and logging.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜