您的位置:首页 > 移动开发 > Android开发

Android 中 Activity的生命周期 和 Log输出

2016-07-09 16:30 525 查看
Log输出

Android系统在用户空间中提供了轻量级的logger日志系统,它是在内核中实现的一种设备驱动,与用户空间的logcat工具配合使用能够方便地跟踪调试程序。

Log.v(tag,message); //verbose模式,打印最详细的日志

Log.d(tag,message); //debug级别的日志

Log.i(tag,message); //info级别的日志

Log.w(tag,message); //warn级别的日志

Log.e(tag,message); //error级别的日志

其中tag和message分别是两个String值.从android开发帮助文档中来看,tag和message的定义分别是:

tag

Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.

msg

The message you would like logged.

可看出tag用来标记log消息的源头的.而message则是这条log的内容.

从日志的输出数量来算,error,warn,info,debug,verbose,数量从少到多.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android