Quick Start Guide
Before going ahead : If you haven't yet added library to your build.gradle file, please refer the Implementation Guide.
Start by initialisation.
Open the application class and add this to it.
class App : Application() {
override fun onCreate() {
super.onCreate()
PinLog.initialiseDebug(this)//If you are testing your app
//OR
PinLog.initialiseRelease(this)//If you are releasing your app
PinLog.setDevLogging(true)//Optional
PinLog.setBuildConfigClass(BuildConfig::class.java)//Optional
}
}Then you need to mention this file in your AndroidManifest.xml like this :
The android:name=".App" line is most important.
You are now done with the application class setup.
Logging
Add this in your MainActivity.kt or any similar file and everything is done. Each time you log a statement it gets saved in PinLog's database.
Getting saved logs
To get your logs use this line.
Deleting saved logs
To delete all the logs use this line :
Listening for new logs
You can also listen for logs by adding listeners. Max limit for listeners is 5
This listener returns a ApplicationLogModel object.
If just want the content of log as a string, you can use this listener instead.
This listener returns a log as String .
Every time you use one of the logging methods the listener is called.
Removing listeners
To remove a previously added Listener call this
To remove all listeners at once call this
Last updated