아래와 같이 isLoggable 이라는 메서드를 사용하여 원하는 로그를 찍고 싶을 경우 system property 값을 원하는 로그 레벨로 변경해 주거나 local.prop 파일을 생성하여 /data/local.prop 으로 위치시켜야 한다. public static void LOGD(final String tag, String message, Throwable cause) { if (LOGGING_ENABLED){ if (Log. isLoggable (tag, Log.DEBUG)) { Log.d(tag, message, cause); } } } system property 값을 변경해 주는 방법은 다음과 같다. adb shell setprop log.tag.<tag> <log level> myLog 라는 tag 를 debug 레벨에서 찍고 싶다면, console 창에서 아래와 같이 써주면 된다. adb shell setprop lgo.tag. myLog DEBUG * 공식사이트에 나와있는 isLoggable 메서드 관련 설명 public static boolean isLoggable ( String tag, int level) Added in API level 1 Checks to see whether or not a log for the specified tag is loggable at the specified level. The default level of any tag is set to INFO. This means that any level above and including INFO will be logged. Before you make any calls to a logging method you should check to see if your tag
댓글
댓글 쓰기