Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

android

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

like image 816
Webnet Avatar asked Nov 18 '11 00:11

Webnet


People also ask

Where is Java console log?

To get access to the Java Console and its log, go to the Windows Control Panel (Start > Control Panel). In that window look for the Java icon and click it to open. On the General tab you will see the 'About' button; click it to find out the version of Java that you are running.

What is console log method?

The console.log() method is used to write messages to these consoles. For example, let sum = 44; console.log(sum); // 44. Run Code.

How do I find the console log?

Console Logs in Chrome: In Google Chrome, the Console Logs are available as a part of Chrome Dev Tools. To open the dedicated Console panel, either: Press Ctrl + Shift + J (Windows / Linux) or Cmd + Opt + J (Mac).

What is Java console output?

Writing Console Output in Java refers to writing the output of a Java program to the console or any particular file. The methods used for streaming output are defined in the PrintStream class. The methods used for writing console output are print(), println() and write().


1 Answers

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.

like image 180
nhaarman Avatar answered Sep 20 '22 11:09

nhaarman