A Beautiful Log Printer For OkHttp.

Related tags

Networking LogDog
Overview

LogDog

A Beautiful Log Printer For OkHttp.

It looks like this:

log review

Import

repositories {
    maven { url 'https://jitpack.io' }
}
//something else...
implementation 'com.github.michaellee123:LogDog:[latest-version]' // find the latest-version in the JitPack badge, it's top of this document.

Use

You just need call a funcation in your OkHttpClient.Builder, If you use retrofit, just need call once when init.

val okHttpClient: OkHttpClient = OkHttpClient.Builder().logDog("LogDog").build()

Or use more arguments:

val logDog = LogDog(
    tag = "LogDog", // for logcat print tag, if you use custom print, the tag will be useless
    enable = BuildConfig.DEBUG, // whether to enable print log
    print = { it ->
        Log.e("LogDog", it) // custom print, you can change the log level, or save the log to disk cache or more.
    },
    gson = GsonBuilder().setPrettyPrinting().serializeNulls().create() // log dog uses gson's pretty printing to format the output json string.
)
val logInterceptor = HttpLoggingInterceptor(logDog) // log dog based from HttpLoggingInterceptor.Logger
logInterceptor.level = HttpLoggingInterceptor.Level.BODY // you can change http log level, see HttpLoggingInterceptor.Level's document.
val okHttpClient = OkHttpClient.Builder().addNetworkInterceptor(logInterceptor).build() // add HttpLoggingInterceptor into OkHttpClient.Builder.

Now all your requests useing OkHttpClient will print a beautiful log.

More Infomations

  1. Font Family: FiraCode, you can also use JetBrains Mono, but I think FiraCode looks better than JetBrains Mono.
  2. Ligatures: open Android Studio's Preferences -> Editor -> Font, check Enable font ligatures.
  3. Logcat setting: disable Soft-Wrap first, then click the gear icon to disable Show package name. Of course, if your screen is very wide, you can ignore this prompt.
You might also like...
BaseDemo 是Android MVVM + Retrofit + OkHttp + Coroutine 协程 + 组件化架构的Android应用开发规范化架构
BaseDemo 是Android MVVM + Retrofit + OkHttp + Coroutine 协程 + 组件化架构的Android应用开发规范化架构

BaseDemo 是Android MVVM + Retrofit + OkHttp + Coroutine 协程 + 组件化架构的Android应用开发规范化架构,通过不断的升级迭代,目前主要分为两个版本,分别为分支 MVVM+Databinding 组件化版本,分支MVVM+Databinding+Single 单体版本。旨在帮助您快速构建属于自己的APP项目架构,做到快速响应上手,另外再长期的实践经验中汇总了大量的使用工具类,主要放在了项目 `lib_common` 组件中,以供大家参考使用。具体使用请开发者工具自己项目需求决定选择如何使用。

Convert OkHttp requests into curl logs.

Ok2Curl Convert OkHttp requests into curl logs. Usage Add library to project dependencies. Library is hosted on jcenter. repositories { jcenter()

🔎 An HTTP inspector for Android & OkHTTP (like Charles but on device) - More Chucker than Chuck
🔎 An HTTP inspector for Android & OkHTTP (like Charles but on device) - More Chucker than Chuck

Chucker A fork of Chuck Getting Started Features Multi-Window Configure Redact-Header️ Decode-Body Migrating Snapshots FAQ Contributing Building Ackno

Mock your datas for Okhttp and Retrofit in json format in just a few moves

okhttp-json-mock This simple library helps you mock your data for using with okhttp+retrofit in json format in just a few moves. it forwards the reque

SimpleInterceptor for okhttp
SimpleInterceptor for okhttp

SimpleInterceptor Simpleinceptor is the interception interface tool of Android okhttp client, which is convenient for testing or development and quick

Android Jetpack MVVM Boilerplate. Integrated with Jetpack dependencies, Hilt, Room, Okhttp, Retrofit, etc.
Android Jetpack MVVM Boilerplate. Integrated with Jetpack dependencies, Hilt, Room, Okhttp, Retrofit, etc.

Android Jetpack MVVM Boilerplate Android Jetpack MVVM Boilerplate a Jetpack based, MVVM boilerplate template project for Modern Android. Features Here

Customizable OkHttp Logging Interceptor

An OkHttp interceptor which logs HTTP request and response data and allows output customization.

Kotlin+Flow+Retrofit+OKHttp+ViewBanding+ViewModel+LiveData封装的一个Kotlin版本的MVVM框架

Gitee 地址:kmvvm Github 地址:kmvvm CHANGE LOG 技术要点 支持Flow+Retrofit+OkHttp实现链式http请求 支持Rxjava+Retrofit+OkHttp实现链式http请求 封装基类:BaseActivity、BaseVMActivity、Ba

A "fluent" OkHTTP library for Kotlin based on string extensions.

okfluent A "fluent" OkHTTP library for Kotlin based on string extensions. Do not take this project seriously, I just wanted to show that this kind of

🎥 Android App using Kotlin, MVVM, ViewModel and LiveData, RxJava, Retrofit, REST API, OkHttp, Gson, Glide, Paging library and Material Design. In the app you can see a list of popular movies and additional info about every movie.
🎥 Android App using Kotlin, MVVM, ViewModel and LiveData, RxJava, Retrofit, REST API, OkHttp, Gson, Glide, Paging library and Material Design. In the app you can see a list of popular movies and additional info about every movie.

Movies 🎥 Android App using Kotlin, MVVM, ViewModel and LiveData, RxJava, Retrofit, REST API (https://www.themoviedb.org), OkHttp, Gson, Glide, Paging

A basic list application designed using MVVM pattern with Retrofit, OkHttp, and Hilt for dependency injection

FRExercise A basic list application designed using MVVM pattern with Retrofit, O

NiceHttp - A small and simple OkHttp wrapper to ease scraping

NiceHttp - A small and simple OkHttp wrapper to ease scraping

A simple okhttp interceptor to mock api's

mockp-interceptor Mockp-interceptor is a library to simplify Android development requests that uses Retrofit and OkHttp. This library will mock reques

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.

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

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. 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

Use an expanded notification as a makeshift Android log output console
Use an expanded notification as a makeshift Android log output console

NotificationLog Use an expanded notification as a makeshift Android log output console. https://vine.co/v/bFxhUAVjvrY The design goals of this project

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.

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

A log collector for Android
A log collector for Android

Puree Description Puree is a log collector which provides the following features: Filtering: Enable to interrupt process before sending log. You can a

Releases(1.0.2)
Owner
Michael Lee
The best cool man in the world
Michael Lee
SimpleInterceptor for okhttp

SimpleInterceptor Simpleinceptor is the interception interface tool of Android okhttp client, which is convenient for testing or development and quick

zhonghua 25 Jun 21, 2022
Customizable OkHttp Logging Interceptor

An OkHttp interceptor which logs HTTP request and response data and allows output customization.

Bartek Wesołowski 22 Aug 13, 2022
A "fluent" OkHTTP library for Kotlin based on string extensions.

okfluent A "fluent" OkHTTP library for Kotlin based on string extensions. Do not take this project seriously, I just wanted to show that this kind of

Duale Siad 0 Nov 23, 2021
A basic list application designed using MVVM pattern with Retrofit, OkHttp, and Hilt for dependency injection

FRExercise A basic list application designed using MVVM pattern with Retrofit, O

null 0 Dec 22, 2021
NiceHttp - A small and simple OkHttp wrapper to ease scraping

NiceHttp - A small and simple OkHttp wrapper to ease scraping

LagradOst 19 Dec 17, 2022
A simple okhttp interceptor to mock api's

mockp-interceptor Mockp-interceptor is a library to simplify Android development requests that uses Retrofit and OkHttp. This library will mock reques

Bruno Gabriel dos Santos 17 Oct 31, 2022
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

Taylor 40 Dec 8, 2022
🗨️ Beautiful Dialog is a Simple and Beautiful custom dialog

Beautiful Dialog ??️ Beautiful Dialog is a Simple and Beautiful custom dialog. Screenshots Including in your project Gradle Add below codes to your ro

Geovani Amaral 21 Jan 6, 2023
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
Android part of the Android Studio(IntellijIDEA) OkHttp Profiler plugin

OkHttpProfiler Android Library Created by LocaleBro.com - Android Localization Platform The OkHttp Profiler plugin can show requests from the OkHttp l

Ievgenii 261 Dec 8, 2022