a914-gowtham / app-logger

A logging library to view logs in app for android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

app-logger

It is a logging library that stores logs locally on the android device. I created this library as an alternate for server logging just to debug issues. it helped to fix some issues that only happened in release build where i did not have access to server logs.

Remove the library usage before publishing on playstore. Its main purpose is to debug specific issues and share the log file.

Download

 // Add it in your root build.gradle at the end of repositories:
dependencyResolutionManagement {
	repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
	repositories {
   	   mavenCentral()
           maven { url 'https://jitpack.io' }
  }
}

// app level build.gradle
dependencies {
   implementation 'com.github.a914-gowtham:app-logger:1.0.0'
}

Usage

Write logs

    // verbose
    AppLogger.writeLog(context, "Navigation screen verbose" +
                "log time ${System.currentTimeMillis()}")
    // info 
    AppLogger.writeILog(context, "Navigation screen " +
                "log time ${System.currentTimeMillis()}")

    // warn 
    AppLogger.writeWLog(context, "Navigation screen " +
                "log time ${System.currentTimeMillis()}")

    // error 
    AppLogger.writeELog(context, "Navigation screen " +
                "log time ${System.currentTimeMillis()}")

View logs

val logViewer = LogViewer(liveLog = false)
logViewer.show(supportFragmentManager, LogViewer.TAG)

About

A logging library to view logs in app for android


Languages

Language:Kotlin 100.0%