SuperLog is a logger for Android Apps. It has always been a trouble to write logs in a file and console seperately. After Marshmallow apps need to ask for explicit permission for accessing file storage. Some apps demand file access but some doesn't. Creating an extra file to maintain logs forces developers to ask permission everytime. SuperLogs allows users to create console logs and persistent logs just with one statement. The logs generated by SuperLog can also be viewed in the app itself. It allows developers focussing on IoT or Android things apps to directly view the logs in the device itself. The logs genertaed by SuperLog can be mailed with developer's ease.
These are the all the instructions you need to use SuperLog in your apps.
Just a simple debug compile
will get you up and running with SuperLog.
compile 'com.ankushgrover:SuperLog:2.0.0'
It's preferable to initialize SuperLog in your application's onCreate()
method.
SuperLog.init(new SuperLog.Builder()
.setSuperLogViewVisibility(true), new ContextWrapper() {
@Override
public Context getContext() {
return getApplicationContext();
}
});
After initialization you can simply add SuperLogView
in any of your layout files. On clicking this view, you will be presented with all the logs created by SuperLog in a color coded format along with some extra functionality.
<com.ankushgrover.superlog.views.SuperLogView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:textStyle="bold" />
You can use normal Log statements to carry out the functionality.
Log.d("TAG", "message"); // debug log
Log.v("TAG", "message"); // verbose log
Log.w("TAG", "message"); // warning log
Log.e("TAG", "message"); // error log
These statements will create logs in android monitor as well as save in persistent storage. Logs generated by these can be easily accessed by tapping SuperLogView.
- Android SDK
- Maven - Dependency Management
This project is licensed under the Apache License, Version 2.0 - see the LICENSE.md file for details