Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.hannesa2:logcat:3.3.1'
}
dependencies {
implementation("com.github.hannesa2:logcat:3.3.1")
}
<dependency>
<groupId>com.github.hannesa2</groupId>
<artifactId>logcat</artifactId>
<version>3.3.1</version>
</dependency>
libraryDependencies += "com.github.hannesa2" % "logcat" % "3.3.1"
:dependencies [[com.github.hannesa2/logcat "3.3.1"]]
This library provides an easy way to show Logcat in release ! and Timber history, which was written to file.
Right Timber FileLoggingTree.kt
is provided too
The easiest way to add Logcat to your project is via Gradle. Just add the following lines to your build.gradle
:
dependencies {
implementation "com.github.AppDevNext.Logcat:LogcatCoreLib:$latest_version"
implementation "com.github.AppDevNext.Logcat:LogcatCoreUI:$latest_version" // UI related classes like Activity, Fragment
implementation 'com.github.AppDevNext.Logcat:LogcatCrashlyticLib:$latest_version'
}
To tell Gradle where to find the library, make sure build.gradle
also contains this:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
In AndroidManifest.xml
<application
android:name="info.hannes.logcat.LoggingApplication"
or for file logging
<application
android:name="info.hannes.logcat.FileLoggingApplication"
Logs a non-fatal via Timber.e() or Timber.w()
externalCacheDir?.let {
Timber.plant(FileLoggingTree(it, this))
}
FirebaseCrashlytics.getInstance().setCustomKey("VERSION_NAME", BuildConfig.VERSION_NAME)
Timber.plant(CrashlyticsTree(Settings.Secure.getString(applicationContext.contentResolver, Settings.Secure.ANDROID_ID)))
styles.xml
or themes.xml
something like<style name="CustomDetailTheme" parent="DetailTheme">
<item name="colorAssertLine">#ff0000</item>
<item name="colorDebugLine">#00ff00</item>
<item name="colorErrorLine">#ff0000</item>
<item name="colorInfoLine">?android:attr/textColorPrimary</item>
<item name="colorVerboseLine">#0000ff</item>
<item name="colorWarningLine">#ffff00</item>
</style>
AndroidManifest.xml
<activity
android:name="info.hannes.logcat.LogfileActivity"
android:label="Timber"
android:theme="@style/CustomDetailTheme" />
To avoid build failure due to higher version of kotlinx-coroutines-android (you are then responsible for loading the excluded required dependencies)
implementation('com.github.AppDevNext.Logcat:LogcatCore:$latest_version') {
exclude group: 'androidx.lifecycle'
exclude group: 'org.jetbrains.kotlin'
exclude group: 'org.jetbrains.kotlinx'
}
Copyright (C) 2025 AppDevNext
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.