LogcatViewer - Android Logcat Viewer
Purpose
LogcatViewer is utility library which will allow user to view the logcat logs of the application on phone itself.
It will be useful for tester to provide logs along with defects and also to developer to do initial analysis of defects.
Moreever, if correct tags are used, it can also be useful for performance measurement, for monitoring network requests etc. etc.
How to plug LogcatViewer in your application?
- Add following line to build.gradle.
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
compile 'com.github.fatangare.LogcatViewer:logcatviewer:aadf092447'
}
- Add following code to launch LogcatViewer floating view. - To launch logcatviewer floating view.
LogcatViewer.showLogcatLoggerView(this);
- Add following services to AndroidManifest.xml. - To register services.
<service android:name="com.fatangare.logcatviewer.service.LogcatViewerService"
android:label="LogcatLoggerService"></service> <service android:name="com.fatangare.logcatviewer.service.LogcatViewerFloatingView"
android:label="LogcatLoggerFloatingView" > </service>
That's all!
It will launch floating window which will show logcat logs of the application.
Since it is floating window, user can play around with the application while viewing logcat logs.
Operations which can be done in LogcatViewer:
- Pause - Pause listening to logcat logs
- Resume - Resume listening to logcat logs
- Start Recording - Start storing logcat logs in file. File is stored in android.os.Environment.DIRECTORY_DOWNLOADS+ "/LogcatViewer/"+ getPackageName() directory. It take filter-text used before recording is started. Any change to filter-text during recording will not update filter-text used for recording. To apply new filter-text for recording, new recording should be started.
- Stop Recording - Stop storing logcat logs in file.
- Enter filter text - Filter logs by filter text. It can be tag, package name or some text.
- Select log level - Filter logs by log level.
- Reset - Show all logcat logs.