Timber + Logger Integration. Make Logcat Prettier, show thread information and more.

Overview

Pretty Timber Android Logcat


Timber + Logger Integration


Video Instructions: https://youtu.be/zoS_i8VshCk


Android Badge androiddevnotes GitHub badge


Timber Logger Integration awesomedevnotes - androiddevnotes youtube thumbnail


Code

App.kt

class App : Application() {
    override fun onCreate() {
        super.onCreate()

        val formatStrategy: FormatStrategy = PrettyFormatStrategy.newBuilder()
            .showThreadInfo(true) // (Optional) Whether to show thread info or not. Default true
            .methodCount(1) // (Optional) How many method line to show. Default 2
            .methodOffset(5) // Set methodOffset to 5 in order to hide internal method calls
            .tag("") // To replace the default PRETTY_LOGGER tag with a dash (-).
            .build()

        Logger.addLogAdapter(AndroidLogAdapter(formatStrategy))


        Timber.plant(object : Timber.DebugTree() {

            override fun log(
                priority: Int, tag: String?, message: String, t: Throwable?
            ) {
                Logger.log(priority, "-$tag", message, t)
            }
        })

        // Usage
        Timber.d("onCreate: Inside Application!")
    }
}

// Dependencies needed in build.gradle (app) file - Remember to update version if required.
// implementation 'com.orhanobut:logger:2.2.0'
// implementation 'com.jakewharton.timber:timber:4.7.1'

Dependencies

implementation 'com.jakewharton.timber:timber:4.7.1'

// https://github.com/JakeWharton/timber
implementation 'com.orhanobut:logger:2.2.0'

// https://github.com/orhanobut/logger

💻 Find us on

You might also like...
Library that makes debugging, log collection, filtering and analysis easier.
Library that makes debugging, log collection, filtering and analysis easier.

AndroidLogger Android Library that makes debugging, log collection, filtering and analysis easier. Contains 2 modules: Logger: 'com.github.ShiftHackZ.

Kotlin multi-platform logging library with structured logging and coroutines support
Kotlin multi-platform logging library with structured logging and coroutines support

Klogging Klogging is a pure-Kotlin logging library that aims to be flexible and easy to use. It uses Kotlin idioms for creating loggers and sending lo

An easy way to customize your log in Android,including output to console, writing log to file in high performance way and so on

EasyLog An easy way to customize your log in Android,including output to console, writing log to file in high performance way and so on. 1. Initializa

Lynx is an Android library created to show a custom view with all the information Android logcat is printing, different traces of different levels will be rendererd to show from log messages to your application exceptions. You can filter this traces, share your logcat to other apps, configure the max number of traces to show or the sampling rate used by the library. It is far easier to design a class to be thread-safe than to retrofit it for thread safety later
It is far easier to design a class to be thread-safe than to retrofit it for thread safety later

"It is far easier to design a class to be thread-safe than to retrofit it for thread safety later." (Brian Goetz - Java concurrency: Publisher: Addiso

Kotlin Multi Platform Logger, for android an ios : Logcat & print

Multiplatform Preferences Use a single object : Logger in your kotlin shared projects to display logs Note you can also use it in your real code on An

A blogging mobile application built with Kotlin using MVC design pattern and Take some advantage of Jetpack , View & Data Binding It's a mimic for Tumblr application , But a little prettier than him 😉
A blogging mobile application built with Kotlin using MVC design pattern and Take some advantage of Jetpack , View & Data Binding It's a mimic for Tumblr application , But a little prettier than him 😉

A blogging mobile application built with Kotlin using MVC design pattern and Take some advantage of Jetpack , View & Data Binding It's a mimic for Tum

Easy Android logging with Kotlin and Timber

Kotlin logging extensions for Timber Jake Wharton's Timber library is great. It's a Java library with an API that works well for Java, but that isn't

(Coroutine, Flow(+StateFlow), Hilt, JetPack, MVVM, Repository Pattern, Retrofit2 & OkHttp3, Moshi, Glide, Timber, Material-Components)

(Coroutine, Flow(+StateFlow), Hilt, JetPack, MVVM, Repository Pattern, Retrofit2 & OkHttp3, Moshi, Glide, Timber, Material-Components)

Integration Testing Kotlin Multiplatform Kata for Kotlin Developers. The main goal is to practice integration testing using Ktor and Ktor Client Mock
Integration Testing Kotlin Multiplatform Kata for Kotlin Developers. The main goal is to practice integration testing using Ktor and Ktor Client Mock

This kata is a Kotlin multiplatform version of the kata KataTODOApiClientKotlin of Karumi. We are here to practice integration testing using HTTP stub

Andorid library that loads images asynchronously into cache using a thread pool
Andorid library that loads images asynchronously into cache using a thread pool

AndroidImageLoader AndroidImageLoader is a fork of the Image Loader component in libs-for-android. The AndroidImageLoader is an Android library that h

Multi-thread ZX0 data compressor in Kotlin

ZX0-Kotlin ZX0-Kotlin is a multi-thread implementation of the ZX0 data compressor in Kotlin. Requirements To run this compressor, you must have instal

Kreds - a thread-safe, idiomatic, coroutine based Redis client written in 100% Kotlin

Kreds Kreds is a thread-safe, idiomatic, coroutine based Redis client written in 100% Kotlin. Why Kreds? Kreds is designed to be EASY to use. Kreds ha

New Relic Kotlin Instrumentation for Kotlin Coroutine. It successfully handles thread changes in suspend states.

new-relic-kotlin-coroutine New Relic Kotlin Instrumentation for Kotlin Coroutine. It successfully handles thread changes in suspend states. Usage 1- U

Colored logcat script which only shows log entries for a specific application package.
Colored logcat script which only shows log entries for a specific application package.

PID Cat An update to Jeff Sharkey's excellent logcat color script which only shows log entries for processes from a specific application package. Duri

Android app that displays the logcat buffer in a system overlay window
Android app that displays the logcat buffer in a system overlay window

Ghost Log Ghost Log is an Android application that displays the device logcat buffer in a system overlay window. NOTE: Device root (superuser) access

A `adb logcat` wrapper
A `adb logcat` wrapper

rogcat ...is a adb logcat wrapper. The Android Debugging Bridge (adb) is the default way to interact with a Android device during development. The log

android logcat
android logcat

android logcat

Movo (Movie Information) is an android application to find out all the Movie Information and Details.

Movo About The Project Screen.Recording.2022-08-12.at.08.53.46_1.mp4 Movo (Movie Information) is an android application to find out all the Movie Info

Owner
Awesome Dev Notes | Android Dev Notes YouTube
Awesome Dev Notes | Android Dev Notes YouTube
An OkHttp interceptor which has pretty logger for request and response. +Mock support

LoggingInterceptor - Interceptor for OkHttp3 with pretty logger Usage val client = OkHttpClient.Builder() client.addInterceptor(LoggingInterceptor

ihsan BAL 1.3k Dec 26, 2022
✔️ Simple, pretty and powerful logger for android

Logger Simple, pretty and powerful logger for android Setup Download implementation 'com.orhanobut:logger:2.2.0' Initialize Logger.addLogAdapter(new A

Orhan Obut 13.5k Dec 30, 2022
Utility logger library for storing logs into database and push them to remote server for debugging

HyperLog Android Overview Log format Download Initialize Usage Get Logs in a File Push Logs Files to Remote Server Sample Testing Endpoint using Reque

HyperTrack 675 Nov 14, 2022
Pluto Logger is a Pluto plugin to manage and share your Debug logs

Pluto Logger Plugin Pluto Logger is a Pluto plugin to manage and share your Debug logs. It also comes with Timber support. ?? Integrate plugin in your

Pluto 1 Feb 8, 2022
A logger with a small, extensible API which provides utility on top of Android's normal Log class.

This is a logger with a small, extensible API which provides utility on top of Android's normal Log class. I copy this class into all the little apps

Jake Wharton 9.9k Jan 8, 2023
Logger

StreamingAndroidLogger Introduction Convenient logger that adds support to having multiple different loggers and different log levels for each one of

Jan Rabe 46 Nov 29, 2022
Napier is a logger library for Kotlin Multiplatform.

Napier is a logger library for Kotlin Multiplatform. It supports for the android, ios, jvm, js. Logs written in common module are displayed on logger

Akira Aratani 457 Jan 7, 2023
Yakl - Yet Another Kotlin Logger

YAKL Yet Another Kotlin Logger. Motivation Current jvm loggers have some disadva

Mark Kosichkin 4 Jan 19, 2022
📄The reliable, generic, fast and flexible logging framework for Android

logback-android v2.0.0 Overview logback-android brings the power of logback to Android. This library provides a highly configurable logging framework

Tony Trinh 1.1k Jan 5, 2023
Simple application to log your mood through the day and explain feature flags.

Mood Logger App (Android version) This Repo This repository contains code for building a very basic application to log your mood through the days. The

MongoDB Developer Relations 3 Oct 24, 2021