Code Monkey home page Code Monkey logo

vlog's Introduction

Vlog

An In-Display real-time logging Library for Android.
Vlog provides an easy and convenient way to access logs right on your phone.

Screenshots

As can be seen in above screenshots, messenger-like bubble is introduced to display logs in a non-intrusive manner. The bubble also shows the count badge to indicate the presence of logs. Along with that, basic filtering capability helps with finding specific logs.

Philosophy

All investigation starts from logs. Whether its an app crash, server error or a login issues, we always check logs to understand the root cause. Quite often, we need to reproduce the issue ourselves and parallely look for logs on our Mac or a PC. If only, we could conveniently look into the logs right on our phones. Well, wait no more, Vlog makes it possible to display logs real time while you interact with your app. There are plenty of other use cases where Vlog can prove to be very convenient,

  • Every now and then, the issue is on the server side. In that case, quickly checking logs and reporting the issue directly to the concerned back-end team can save a lot of time.
  • Verify user analytics logs (useful for product team)
  • Debug on the go

Getting Started

Gradle Dependency

Add maven source in root build.gradle:

allprojects {
 repositories {
  ...
  maven { url 'https://jitpack.io' }
 }
}

Add the library dependency in module build.gradle:

dependencies {
 implementation 'com.github.girish3:Vlog:v0.1.1'
}

Basic

The Vlog exposes easy-to-use APIs and has same logging methods as Android's Log utility ( Log.v, Log.d...)

val vlog = Vlog.getInstance(context) 
// In the above code, make sure to pass application context as an argument instead of Activity context

// start vlogging (the bubble will appear)
vlog.start()

vlog.v("<tag>", "<log message>") // verbose log
vlog.e("<tag>", "<log message>") // error log

// stop vlogging
vlog.stop()

// check if vlog is currently active
vlog.isEnabled() // returns true if vlog.start() was called

Advanced

Often, there is a need to not just print logs but also either to save them in a local file or upload it to a server. The Chain of responsibility pattern is a recommended pattern for such needs. In this pattern, each object in the chain receives the log data and can therefore be responsible to print the log statement (logcat), save in a file, or, in our use-case, pass the data to Vlog library. Refer sample app in this repo for more details. For a quick setup, the app's logger folder can directly be copy-pasted in any Android project.

Contribute

Feel free to raise issues, suggest changes and you are more than welcomed to fork and submt the Pull request.

vlog's People

Contributors

girish3 avatar bhardwaj49 avatar kaustubhpatange avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.