got-your-back icon indicating copy to clipboard operation
got-your-back copied to clipboard

Feature Request: Control how verbose output is

Open billdenney opened this issue 4 years ago • 10 comments

As described in https://groups.google.com/forum/#!searchin/got-your-back/verbose%7Csort:date/got-your-back/50TDppD3-5E/971Z6SwtFwAJ, it would be helpful to have optionally quieter output.

Full steps to reproduce the issue:

  1. Run GYB (especially as a cron job)
  2. See many lines showing all updates

Expected outcome (what are you trying to do?): I'd like to optionally see less output. I'd think that a numeric --verbose=<#> argument would cover what I'm thinking of. The levels that occur to me are:

  1. Silent except for fatal errors
  2. Warnings but no other information
  3. Everything from lower levels and statistics on completion of a step but not status messages during the step
  4. Everything from lower levels and status messages during the step (this is the current output)
  5. Everything from lower levels and the current output from --debug

billdenney avatar Feb 23 '20 15:02 billdenney

Hi Jay,

Just wanted to let you know that billdenney recruited me to complete this enhancement. I will be submitting a pull request soon.

-Alana

alanapradhan avatar Apr 15 '20 03:04 alanapradhan

@jay0lee , I've been using @alanapradhan's PR for a while, and it is much more usable for scheduled jobs. Do you think it's a good fit for a merge?

billdenney avatar Jun 21 '20 11:06 billdenney

@jay0lee happy to work through any concerns you might have about the pull request

alanapradhan avatar Jun 22 '20 23:06 alanapradhan

Let me see if I can test it out this week but if there are no issues I can merge.

On Mon, Jun 22, 2020, 7:02 PM alanapradhan [email protected] wrote:

@jay0lee https://github.com/jay0lee happy to work through any concerns you might have about the pull request

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jay0lee/got-your-back/issues/247#issuecomment-647811063, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDIZMCRYCNCNACB5XA5IZTRX7PHHANCNFSM4KZ3OXLA .

jay0lee avatar Jun 22 '20 23:06 jay0lee

Thanks!

billdenney avatar Jun 23 '20 00:06 billdenney

Sorry it's taken me forever to take a look. In general it looks good. rewrite_line() was an attempt by me to let GYB "say" more while taking less space. However it clearly made a mess for scheduled jobs and it's probably outlived it's usefulness. I suggest we try just doing away with it and making all of those calls just call logging at an appropriate level instead.

Also, what was the reasoning behind making DEBUG the default level and logging most informative messages under that instead of INFO?

jay0lee avatar Jul 03 '20 18:07 jay0lee

Choosing DEBUG as the default level was, I think, to try to make the output approximately match current output. One thing that we were trying to do was not rock the boat too much in terms of what is printed out. When I've been using the patch locally, I've definitely been using INFO.

I know with some projects like this, I've known the assistance to new users (to prevent excess help requests) is the best solution (therefore show DEBUG). But, you definitely know your user base better than we do! :)

I think that you're also suggesting to remove the rewrite_line() functionality and just make it show at a detailed level like DEBUG, instead. Is that correct?

We can take another shot at choosing the best level, but I'm guessing that final tweaks on the right level of information for each message may be simpler for you to do. (I'm not trying to push the work to you-- I'm just assuming that after another shot at categorizing the messages to the right level, if there are more tweaks, it may be easier for you to make remaining tweaks.)

billdenney avatar Jul 03 '20 21:07 billdenney

Hi @jay0lee, I wanted to let you know that I updated the pull request. I removed the rewrite_line function and attempted to change the verbosity level of some the logging messages so the noisiest logs will be under "DEBUG". I changed the default verbosity setting to "INFO". I did my best to update some of the logging calls and choose a more appropriate level. Unfortunately, I don't know the code base well and can only make my best guess.

alanapradhan avatar Sep 07 '20 00:09 alanapradhan

I ended up here looking for a --quiet flag so cron would email me only if there was a problem. So that's a 👍 asking for this PR to be merged.

paour avatar May 12 '21 06:05 paour

Hi, any chance this could be picked up again? From the comments it sounds like the pull request is very close.

scelfo avatar Aug 13 '21 14:08 scelfo