Android的生产测井最佳实践 [英] Android Production Logging Best Practice

查看:100
本文介绍了Android的生产测井最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是最好的做法,以登录在生产模式Android应用程序,同时要注意以下要求:

What are the best practices for logging in Android apps in production mode, keeping in mind the following requirements :

  1. 能够上传日志调试

  1. Ability to upload logs for debugging

能够清​​理日志或设置翻车

Ability to clean up logs or set rollovers

感谢

推荐答案

我们的preference是自动上传唯一的例外。对于客户端登录,我们preFER有选择地设置一个标志,或者,我们给客户提供问题的一个特殊的调试版本。

Our preference is to automatically upload only exceptions. For client logging we prefer to selectively set a flag or have a special debug version that we give to clients with problems.

异常捕获可以与线程来完成。是,setDefaultUncaughtExceptionHandler()。没有与此有些注意事项(主要是你需要退出()完成后,与异常处理应用程序)。参见:<一href="http://groups.google.com/group/android-developers/browse_thread/thread/c32e8c6120bed5c5/54c28b745c0fca80">http://groups.google.com/group/android-developers/browse_thread/thread/c32e8c6120bed5c5/54c28b745c0fca80

Exception catching can be done with Thread. setDefaultUncaughtExceptionHandler(). There are some caveats with this (mainly you need to exit() the app after done with exception handling). See: http://groups.google.com/group/android-developers/browse_thread/thread/c32e8c6120bed5c5/54c28b745c0fca80

有关日志收集请参见 Android系统日志收集。没有必要使用全包,查看源和复制粘贴。

For log collection see android-log-collector. No need to use the whole package, see the source and copy-paste.

这篇关于Android的生产测井最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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