What is the correct way to set log levels programmatically (i.e. from input params) without becoming dependent on an implementation? I am now using slf4j api in my java library but the same codebase serves as a CLI utility which needs to be able to set log levels ...
If you use dependency injection (e.g. Spring) then you can inject and configure any logger without hard coupling to it.
I think thats always implementation dependent
the cli frontend part should be a seperately distributed lib which pulls in a logging impl