python-cli-ui icon indicating copy to clipboard operation
python-cli-ui copied to clipboard

Breaking: add `verbose()`, controlled with `verbose`

Open gdubicki opened this issue 3 years ago • 7 comments

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).

gdubicki avatar Nov 04 '22 22:11 gdubicki

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.

gdubicki avatar Nov 04 '22 22:11 gdubicki

Wdyt, @dmerejkowsky?

gdubicki avatar Nov 04 '22 22:11 gdubicki

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:

python-cli-ui levels and verbosity

gdubicki avatar Nov 20 '22 09:11 gdubicki

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. verbosity that will be the sole new way of configuring, well, the verbosity. I would make it an enum accepting: debug, verbose, normal and quiet.
  • make the old arguments debug and quiet work 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 avatar Nov 20 '22 16:11 gdubicki

@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

dmerejkowsky avatar Dec 22 '23 15:12 dmerejkowsky

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. :)

gdubicki avatar Apr 06 '24 13:04 gdubicki

A gentle reminder, @dmerejkowsky :)

gdubicki avatar Apr 14 '24 09:04 gdubicki