Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** Builder code to return your CustomSdk implementation */
- class CustomSdkBuilder {
- private var logger: Logger = NoOpLogger()
- fun logger(logger: Logger) = apply {
- if (isDebuggable) {
- this.logger = AndroidLogger()
- else {
- // logging is disabled in Release builds
- }
- }
- /** Builds the UserProfileSdkImpl. */
- fun build(): CustomSdk {
- return CustomSdkImpl(
- logger = logger // will be NoOpLogger in Release builds
- )
- }
- // BAD!!!
- private val isDebuggable: Boolean = if (BuildConfig.DEBUG) true else false
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement