When do I use Log.v(), Log.d(), Log.i(), Log.w(), and Log.e() on Android?

Asked 2 years ago, Updated 2 years ago, 117 views

Log.v(); // Verbose
Log.d(); // Debug
Log.i(); // Info
Log.w(); // Warning
Log.e(); // Error

The comment next to it is a rough one that I know. What do these methods mean in LogCat?

android logcat

2022-09-21 22:52

1 Answers

static int Log.d (String tag, String msg [, Throwable tr]) d stands for debug and is the log for debug. The output is black and blue on the DDMS Logcat.

static int Log.e (String tag, String msg [, Throwable tr]) e stands for error and is the log for error. The system usually takes advantage of this when an exception or error occurs. The color is red.

static int Log.w (String tag, String msg [, Throwable tr]) w stands for warning and displays a warning. It is usually used when an exception occurs. (differentiated from error.) The color is orange.

static int Log.i (String tag, String msg [, Throwable tr]) i stands for information and is used to display general information. The color is green.

static int Log.v (String tag, String msg [, Throwable tr]) v stands for verbose, and the color is black. Log for use only during development.


2022-09-21 22:52

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.