{"repo":"square/logcat","free":true,"listed":false,"github":"https://github.com/square/logcat","clone":"git clone https://github.com/square/logcat.git","description":"I CAN HAZ LOGZ?","language":"Kotlin","stars":983,"topics":["android","logging","cats"],"license":"Apache-2.0","category":"mobile-apps","readme_excerpt":"Square Logcat A tiny Kotlin API for cheap logging on top of Android's normal Log class. Table of contents Setup Usage Motivations License This fantastic logo is brought to you by @rjrjr. Setup Add the logcat dependency to your library or app's build.gradle file: Install AndroidLogcatLogger in Application.onCreate() : Usage The logcat() function has 3 parameters: an optional priority, an optional tag, and a required string producing lambda. The lambda is only evaluated if a logger is installed and the logger deems the priority loggable. The priority defaults to LogPriority.DEBUG . The tag defaults to the class name of the log call site, without any extra runtime cost. This works because logcat() is an inlined extension function of Any and has access to this from which it can extract the class name. If logging from a standalone function which has no this , use the logcat overload which requires a tag parameter. The logcat() function does not take a Throwable parameter. Instead, the library provides a Throwable extension function: Throwable.asLog() which returns a loggable string. Motivations We built this small library to fit the specific needs of the Square Point of Sale application. We used Timber heavily before that, and love the simplicity of its API and the ability of its DebugTree to automatically figure out from which class it's being called from and use that class name as its tag. Here are our motivations for replacing it with logcat() in the Square Point of Sale: - Kot","default_branch":null,"files":null,"tree":[],"storefront":"/r/square","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/square/logcat/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}