Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. /** Builder code to return your CustomSdk implementation */
  2. class CustomSdkBuilder {
  3.  
  4. private var logger: Logger = NoOpLogger()
  5.  
  6. fun logger(logger: Logger) = apply {
  7. if (isDebuggable) {
  8. this.logger = AndroidLogger()
  9. else {
  10. // logging is disabled in Release builds
  11. }
  12. }
  13.  
  14. /** Builds the UserProfileSdkImpl. */
  15. fun build(): CustomSdk {
  16. return CustomSdkImpl(
  17. logger = logger // will be NoOpLogger in Release builds
  18. )
  19. }
  20.  
  21. // BAD!!!
  22. private val isDebuggable: Boolean = if (BuildConfig.DEBUG) true else false
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement