Skip to content
Advertisement

What’s the console.log() of java?

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

Advertisement

Answer

The Log class:

API for sending log output.

Generally, use the Log.v() Log.d() Log.i() Log.w() and Log.e() methods.

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.

Outside of Android, System.out.println(String msg) is used.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement