python-cli-ui
python-cli-ui copied to clipboard
Breaking: add `verbose()`, controlled with `verbose`
in setup() and make debug() controlled with debug in setup.
This will allow writing apps that have a more granular level of verbosity:
- quiet (warning-fatal)
- normal (info-fatal),
- verbose (verbose-fatal),
- debug (debug-fatal = all).
I think that this is the way it should be done.
Without this feature I had to do an ugly hack in my GitLabForm app where I used logging.debug() for the "debug" verbosity level and cli_ui.debug() imported as verbose() as the "verbose" level - see https://github.com/gitlabform/gitlabform/commit/4610bd50782239635b49fffe384bc56d28ddaba4.
Wdyt, @dmerejkowsky?
If you are ok with such a change then I would add the appropriate docs and an upgrade guide, @dmerejkowsky.
I think that an image showing the levels and the verbosity levels would help. I prepared a draft of such an image:

After giving it more thought, I would like to apply some of the philosophy of a more user-friendly software development process taken from here https://gitlabform.github.io/gitlabform/#stability to python-cli-ui and do this:
- introduce a new argument for
setup(), f.e.verbositythat will be the sole new way of configuring, well, the verbosity. I would make it an enum accepting:debug,verbose,normalandquiet. - make the old arguments
debugandquietwork the same way as they do now did but log a warning when they are used, stating that it is deprecated and that it will go away in the next major version of this library.
@gdubicki : sorry for the long delay - do you still want to work on this ? - your plan to do it in a non-breaking way looks like a good idea to me
Hi, @dmerejkowsky! Yes, I might want to get back to this.
PS Can you please add my PyPI account (gdubicki) as a maintainer for this project in PyPI? I would like make a 0.18.0 release with what's currently in the main branch. :)
A gentle reminder, @dmerejkowsky :)