Khi tôi viết một trình bao bọc nhật ký cho ứng dụng Android của mình, tôi nhận thấy một hành vi kỳ lạ của phương thức Log.isLoggable của android. Thực thi mã sau:Log.isLoggable có trả về giá trị sai không?
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));
sản xuất sau đầu ra LogCat:
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
Tại sao tôi nhận verbose và gỡ lỗi không hoạt động mặc dù tôi tạo ra những kết quả đầu ra sử dụng tiết và gỡ lỗi đăng nhập?
Liên kết bị hỏng, Vui lòng cập nhật liên kết. –