Android SDK Logging
ENGAGE® Android SDK Logging
The ENGAGE SDK includes a logging interceptor that will allow the host app to access the logs that come from the SDK.
import android.app.Application
import com.firstorion.engage.core.EngageApp
import com.firstorion.engage.core.IEngageLoggingInterceptor
class MainApplication: Application(), IEngageLoggingInterceptor {
override fun onCreate(){
super.onCreate()
//Enable logging of Engage SDK
EngageApp.Settings.setLoggingInterceptor(this)
}
override fun intercept(message: String, level: Int){
println("engage.app $message")
}
}
The ENGAGE SDK also allows you to set the logging level. Logging level sets the minimum Logging Level as defined in Android’s Log class. Default level is set to Log.VERBOSE:
EngageApp.Settings.setMinimumLoggingLevel(Log.WARNING) // or Log.ERROR etc.
For Flutter Plugin:
To enabled the logs for the Anroid ENGAGE SDK in the Flutter Plugin, use
FlutterApplication()
instead ofApplication
class:import io.flutter.app.FlutterApplication class MyApplication : FlutterApplication(), IEngageLoggingInterceptor { override fun onCreate() { super.onCreate() EngageApp.Settings.setLoggingInterceptor(this) } override fun intercept(message: String, level: Int) { println("engage.app $message" ) } }
Updated 7 months ago
What’s Next