什么是Java的console.log()? [英] What's the console.log() of java?
问题描述
我正在开发一个Android应用,我想知道最好的调试方法是像javascript中的console.log一样进行调试
I'm working on building an Android app and I'm wondering what the best approach is to debugging like that of console.log in javascript
推荐答案
Log 类:
用于发送日志输出的API.
API for sending log output.
通常,使用Log.v()
Log.d()
Log.i()
Log.w()
和Log.e()
方法.
Generally, use the Log.v()
Log.d()
Log.i()
Log.w()
and Log.e()
methods.
详细程度从最小到最大的顺序是ERROR
,WARN
,
INFO
,DEBUG
,VERBOSE
.详细信息绝不能编译为
应用程序,开发期间除外.调试日志已编译但
在运行时被剥离.错误,警告和信息日志将始终保留.
The order in terms of verbosity, from least to most is ERROR
, WARN
,
INFO
, DEBUG
, VERBOSE
. Verbose should never be compiled into an
application except during development. Debug logs are compiled in but
stripped at runtime. Error, warning and info logs are always kept.
在Android之外,使用System.out.println(String msg)
.
Outside of Android, System.out.println(String msg)
is used.
这篇关于什么是Java的console.log()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!