Difference between log methods

前端 未结 4 1452
忘掉有多难
忘掉有多难 2021-01-03 01:14

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 so

相关标签:
4条回答
  • 2021-01-03 01:27

    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

    0 讨论(0)
  • 2021-01-03 01:27
    int ASSERT Priority constant for the println method.
    int DEBUG Priority constant for the println method; use Log.d.
    int ERROR Priority constant for the println method; use Log.e.
    int INFO Priority constant for the println method; use Log.i.
    int VERBOSE Priority constant for the println method; use Log.v.
    int WARN Priority constant for the println method; use Log.w.
    
    0 讨论(0)
  • 2021-01-03 01:29

    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

    0 讨论(0)
  • 2021-01-03 01:34

    There is a difference in severity;

    Log.e() will simply log an error to the log with priority ERROR.
    

    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.

    0 讨论(0)
提交回复
热议问题