ktee
ktee copied to clipboard
No-Op Implementation
Edit:
With this PR, two artifacts will be published, ktee and ktee-noop.
As the name suggests, ktee-noop has no internal functionality and it can be used in production environment with no overhead.
~~With this PR, the user can enable or disable logging and printing by setting
KTee.debugvariable true or false.~~~~This can be automated depending your build, for example in Android the user can set the variable as
KTee.debug = BuildConfig.DEBUGat the start of his app.~~~~By default is set to true.~~
PS. I think this was suggested by someone in Reddit.
Fixed the second issue.
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities (and
0 Security Hotspots to review)
0 Code Smells
Can we look at alternative like a No-Op interface just like slf4j. That way dependency can be swapped at build/compile time without having to change code. in no-op impl all the methods essentially do not output anything. We can produce two artifacts ktee and ktee-noop?
Kudos, SonarCloud Quality Gate passed!  
@kdabir, coming from the "Android world" where build types and flavors are a thing in Gradle, I can't be so sure I implemented the No-Op artifact publication in the best way possible. Please, let me know if there's something that can be improved.
apologies for the delay in responding. The changes are looking good. For no-op project, we could go with a multi-module approach rather than additional source set. However, I don't necessarily see problem with current approach too. Let me review this and provide more specific feedback. Thanks for incorporating the feedback.
Of course, I'm up for giving a try to any better solution. Could you please give me more info on how to approach a multi-module solution and what are the advantages compared to the current?
Kudos, SonarCloud Quality Gate passed!  
If someone is looking for this feature, I released a modified version here. Using a noop implementation in production does make reverse engineering slightly harder, thus I recommend it unconditionally in any non server-side code.






