When I was writing a log wrapper for my android application I noticed a strange behavior of androids Log.isLoggable method. Executing following code:
final String TAG = "Test";
Log.v(TAG, "verbose is active: " + Log.isLoggable(TAG, Log.VERBOSE));
Log.d(TAG, "debug is active: " + Log.isLoggable(TAG, Log.DEBUG));
Log.i(TAG, "info is active: " + Log.isLoggable(TAG, Log.INFO));
Log.w(TAG, "warn is active: " + Log.isLoggable(TAG, Log.WARN));
Log.e(TAG, "error is active: " + Log.isLoggable(TAG, Log.ERROR));
produces following LogCat output:
VERBOSE/Test(598): verbose is active: false
DEBUG/Test(598): debug is active: false
INFO/Test(598): info is active: true
WARN/Test(598): warn is active: true
ERROR/Test(598): error is active: true
Why do I get verbose and debug is not active although I produce these outputs using verbose and debug logging?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…