I'm continuing work on my first android library. (...
# library-development
c
I'm continuing work on my first android library. (its technically an android lib). I want to add logs that are only available during "debug" in android and not in release (don't want 3rd party consumers to have logs). whats sorta the go-to here? I guess I can create a logger interface with BuildConfig.DEBUG. personally i wanted to use squares logcat lib, (but it looks like typically the App is in control of turning off/on that logger)
d
m
Only publish a single variant and expose listeners instead of logging: https://publicobject.com/2022/05/01/eventlisteners-are-good/
👏🏽 1
☝️ 5
c
So we do only publish a single variant. but when we test we have a sample app in our local repo. hence why I thought maybe adding something to debug only. but i guess "expose listeners" instead of logging should work. in my head that means just adding like an optional callback/lamda in library init and everything will get funnelled there?
i haven't read that blog yet. so let me get on that. im sure its another jesse wilson banger 🐐
great post. now I think i have two problems though (with a solution for one at least) 1. I think I want "general" logs for consumers of the lib (solved by jesse wilsons blog post) 2. and logs "just for us" to help us debug (this is still where i wonder if I should do something else) hm