Use an expanded notification as a makeshift Android log output console

Overview

NotificationLog

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

https://vine.co/v/bFxhUAVjvrY

Screenshots

The design goals of this project are as follows:

  • Provide an on-device view of explicit log output during app development.
  • Do not disrupt the normal lifecycle of the app (no app switching).
  • Transparent implementation (using the same API as android.util.Log, easily disabled).
  • Minimal setup.

This library does not currently output the system LogCat, only messages explicitly logged within the app. The status of this project should be considered "experimental".

Usage

Include the jar file (run ant jar to build from source, or download it here) in your project. NotificationLog has the same API as android.util.Log. You should switch your imports to com.readystatesoftware.notificationlog.Log.

By default, NotificationLog behaves exactly the same as android.util.Log. To enable the additional notification logging, you must first initialize the class for notifications. You might want to do that in your Application class like so:

@Override
public void onCreate() {
    super.onCreate();
    if (BuildConfig.DEBUG) {
        Log.initialize(this);
    }
}

Once initialized, the Log.v(), Log.d(), Log.i(), Log.w(), Log.e() and Log.wtf() methods will write to the notification. This can be enabled or disabled at any time using the Log.setNotificationsEnabled() method.

Advanced Integration

To display a more detailed view of the log buffer and provide additional filter, level and clear actions, you must add the following to your manifest:

<activity 
    android:name="com.readystatesoftware.notificationlog.LogActivity" 
    android:exported="true"
    android:launchMode="singleTop" />

Toasts

You can have log messages additionally appear as Toasts by using the Log.setToastsEnabled() method. This is disabled by default and should not be enabled during any performance critical code. Toast notifications will not appear when the Log methods are called off of the main thread.

Credits

Author: Jeff Gilfelt

License

Copyright 2013 readyState Software Ltd

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.
You might also like...
A super fast build tool for Android, an alternative to Instant Run
A super fast build tool for Android, an alternative to Instant Run

Freeline Freeline is a super fast build tool for Android and an alternative to Instant Run. Caching reusable class files and resource indices, it enab

Command-line tool to count per-package methods in Android .dex files

dex-method-counts Simple tool to output per-package method counts in an Android DEX executable grouped by package, to aid in getting under the 65,536

View Inspection Toolbar for Android Development
View Inspection Toolbar for Android Development

View Inspector Plugin View inspection toolbar for android development. Features Boundary show outlines show margins show paddings Layer Scalpel featur

Make Android screenshots of scrollable screen content
Make Android screenshots of scrollable screen content

scrollscreenshot Make Android screenshots of scrollable screen content - brought to you by PGS Software SA This tool makes a number of screenshots, sc

🍼Debug Bottle is an Android runtime debug / develop tools written using kotlin language.
🍼Debug Bottle is an Android runtime debug / develop tools written using kotlin language.

🇨🇳 中文 / 🇯🇵 日本語 / 🇬🇧 English 🍼 Debug Bottle An Android debug / develop tools written using Kotlin language. All the features in Debug bottle are

[] Dissect layout traversals on Android
[] Dissect layout traversals on Android

Probe Dissect layout traversals on Android. Features Intercept View methods. onMeasure(int, int) onLayout(boolean, int, int, int, int) draw(Canvas) an

Android Library Finder
Android Library Finder

alfi Android Library Finder Search through thousands of android libraries that can help you scale your projects elegantly Usage Search for something a

Annotation based simple API flavored with AOP to handle new Android runtime permission model

Let Annotation based simple API flavoured with AOP to handle new Android runtime permission model. If you check Google's Samples about the new permiss

Combines tools for fast android app devlopment

Android - Rapid Test Driven Development Combine tools to generate most of the boilerplate code. Examples how to test different aspects of an android a

Owner
Jeff Gilfelt
Jeff Gilfelt
Generate inspections from output of executables

tool-to-inspection Template ToDo list Create a new IntelliJ Platform Plugin Template project. Get known with the template documentation. Verify the pl

null 2 Oct 23, 2021
A tool to install components of the Android SDK into a Maven repository or repository manager to use with the Android Maven Plugin, Gradle and other tools.

Maven Android SDK Deployer Original author including numerous fixes and changes: Manfred Moser [email protected] at simpligility technologies i

simpligility 1.4k Dec 27, 2022
A tool to install components of the Android SDK into a Maven repository or repository manager to use with the Android Maven Plugin, Gradle and other tools.

Maven Android SDK Deployer Original author including numerous fixes and changes: Manfred Moser [email protected] at simpligility technologies i

simpligility 1.4k Dec 27, 2022
Use a jar executable to create a Drawable class to display a SVG on Android.

SVG2Drawable Use a jar executable to create a Drawable class to display a SVG on Android. This is a standalone library, not a Runtime Android library.

Stan Kocken 202 Nov 28, 2022
A library which will save you a lot of time from writing the same intent creation code. it consist of many intent creation codes like Share, Contacts, Email and etc, which you can easily use.

Android-Intent-Library A library which will save you a lot of time from writing the same intent creation code. it consist of many intent creation code

Next 67 Aug 24, 2022
An easy to use translation / localization api written in Kotlin that can be used with Java and Kotlin

KTranslate KTranslate is an easy to use TranslationAPI written in Kotlin, with currently 26 supported languages. It is very easy to use in Kotlin and

Felix Beinssen 0 Sep 2, 2022
This is a Android Studio/ IntelliJ IDEA plugin to localize your Android app, translate your string resources automactically.

#Android Localizationer This is a Android Studio/ IntelliJ IDEA plugin to localize your Android app, translate your string resources automactically. T

Wesley Lin 822 Dec 8, 2022
Automated-build-android-app-with-github-action - CI/CD Automated Build Android App Bundle / APK / Signed With Github Action

Automated Build Android With Using Github Action Project Github Action Script Us

Faisal Amir 34 Dec 19, 2022
proguard resource for Android by wechat team

AndResGuard Read this in other languages: English, 简体中文. AndResGuard is a tooling for reducing your apk size, it works like the ProGuard for Java sour

shwenzhang 8.1k Jan 9, 2023