IDE & Framework/Android

Android Log 라이브러리 Timber

Greensky0026 2022. 2. 24. 19:11
반응형

Kotlin으로 Log를 사용하면 [ Using 'Log' instead of 'Timbe' ]라는 문구를 확인할 수 있습니다.

Timber는 다음의 장점이 있습니다.

1. 태그를 별도로 입력할 필요가 없다.

2. 릴리즈때 로그를 출력하지 않는다.

3. 충돌보고 라이브러리와 통합이 쉽다

 

사용법

app level gradle에 의존성을 추가

repositories {
  mavenCentral()
}

dependencies {
  implementation 'com.jakewharton.timber:timber:5.0.1'
}

초기화

Application 클래스의 omCreate()에 다음과 같이 입력합니다.

*Application 클래스를 상속받는 클래스를 생성해 Manifest의 application 태그의 name에 클래스명을 입력해야 합니다!

Timber.plant(Timber.DebugTree())

사용

Timber.i("hellow world!")

 

 

더 자세한 내용은 깃헙에서 확인하세요!

https://github.com/JakeWharton/timber

 

GitHub - JakeWharton/timber: A logger with a small, extensible API which provides utility on top of Android's normal Log class.

A logger with a small, extensible API which provides utility on top of Android's normal Log class. - GitHub - JakeWharton/timber: A logger with a small, extensible API which provides utility on...

github.com

 

반응형