The framework has a configuration DSL, which can be invoked in the onCreate
method of your Application
class.
Its usage looks like the following:
override fun onCreate() {
super.onCreate()
rainbowCake {
isDebug = false
logger = Loggers.NONE
consumeExecuteExceptions = true
}
}
The available settings, and their possible values:
isDebug
: Boolean, false
by default.logger
. May affect other behaviour in the future as well (in debug mode, prod behaviour will definitely not change). Recommended value is BuildConfig.DEBUG
.consumeExecuteExceptions
: Boolean, true
by default.execute
method in RainbowCakeViewModel
should catch and log any uncaught exceptions in coroutines, or let them crash the app. Recommended to be set to false
at the very least for debug builds, and should be considered even for production.logger
: enum, Loggers.NONE
by default.Loggers.NONE
(as in no logging) and Loggers.ANDROID
(logs to Logcat via Log.d
).rainbowcake-timber
dependency is included, Loggers.TIMBER
may also be used to log via Timber. Note that this doesn’t plant
any Tree
s, you still have to do that yourself.