Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between log methods

Tags:

java

android

I am new in android and i print log-cat using:

Log.w("Tag", "String text");

and log text print but after searching for a time i find some more way to print logcat like:

Log.v() 
Log.d()

and now i am confuse in these methods.

Which is the best method for print log-cat and how may method for print lagcat and also what is the main difference between them?

like image 330
Pari Avatar asked Apr 04 '12 06:04

Pari


People also ask

What is the difference between natural log and log?

Natural logarithms are different than common logarithms. While the base of a common logarithm is 10, the base of a natural logarithm is the special number e. Although this looks like a variable, it represents a fixed irrational number approximately equal to 2.718281828459.

What is the difference between ln and log in calculator?

The difference between log and ln is that log is defined for base 10 and ln is denoted for base e. For example, log of base 2 is represented as log2 and log of base e, i.e. loge = ln (natural log).

What is debug and verbose?

With DEBUG, you are giving diagnostic information in a detailed manner. It is verbose and has more information than you would need when using the application. DEBUG logging level is used to fetch information needed to diagnose, troubleshoot, or test an application.

Where do we use log and ln?

The log function is more widely used in physics when compared to ln. As logarithms are usually taken to the base in physics, ln is used much less. Mathematically, it can be represented as log base 10. Mathematically, ln can be represented as log base e.


2 Answers

commonly used Log methods are five :

Log.v () VERBOSE

Log.d () DEBUG

Log.i () INFO

Log.w () WARN

Log.e () ERROR

1: Log.v - debugging color black , and any messages will be output, where v represents the verbose verbose mean, usually is Log.v ("", "");

2: Log.d - the output color is blue , the only output debug debugging meaning, but he would output the upper filter up through of DDMS Logcat label to select.

3: Log.i - output color is green , general tips, news information, it does not the output Log.v Log.d information, but will display the information of i, w and e

4: Log.w - mean orange , can be seen as a warning The warning, in general we need to optimize the Android code, and will output it after Log.e.

5: Log.e - is red , you can think of error error here only to show the red error message, these errors we need careful analysis.

For more information:

http://developer.android.com/guide/developing/debugging/debugging-log.html

like image 188
ρяσѕρєя K Avatar answered Sep 29 '22 03:09

ρяσѕρєя K


The various single-letter methods indicate the severity of the log message. Subsequently, you can filter log messages based on both the tag and the severity, and prevent lesser-severity messages from being shown in your released application (for example).

For more information:

http://developer.android.com/guide/developing/debugging/debugging-log.html

like image 30
Jason LeBrun Avatar answered Sep 29 '22 02:09

Jason LeBrun