Project

General

Profile

Bug #14725

Verbose mode does not work and is inconsistent

Added by Lukas Zapletal over 2 years ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Category:
Hammer core
Target version:
-
Team Backlog:
Marek
Fixed in Releases:
Found in Releases:

Description

Global flag -v does not seem to work at all.

Do not remove it, it makes sense to have it. In UNIX, commands usually do not print info messages (like "Host created"). Create a method like print_verbose and use it for all info messages (crate, update, delete). These messages should appear on stdout only when -v flag was provided.


Related issues

Related to Hammer CLI - Tracker #14914: Tracker for output related issuesNew2016-05-03

Related to Hammer CLI - Feature #24110: hammer host list add fields domain_name and last_checkinNew
Related to foreman-tasks - Feature #24581: Add option to completely suspend progress bar from hammer commandsClosed

Associated revisions

Revision b5594035 (diff)
Added by Oleh Fedorenko 2 months ago

Fixes #14725 - Verbose mode does not work and is inconsistent

History

#1 Updated by Tomáš Strachota over 2 years ago

#2 Updated by Tomáš Strachota over 2 years ago

  • Target version set to 115

#3 Updated by Oleh Fedorenko about 1 year ago

  • Assignee set to Oleh Fedorenko
  • Status changed from New to Assigned

#4 Updated by Tomáš Strachota about 1 year ago

I'm adding some implementation notes.

At the moment -v has the same effect as -d - it prints logs to stdout. I don't think it was a good choice and in my opinion we should keep only -d for that purpose. At the same time I think it would be confusing for users if we suddenly started using that flag for something else. We should deprecate it first. --verbosity or something similar could be used from the start (it's longer I know).

Verbosity should be added to following places in hammer output:
  • add verbosity attribute to #print_message, default is 1
  • add verbosity attribute to #print_error, not sure what the default value should be here
  • add verbosity to fields in output definition
    All those messages/fields would be printed only when their verbosity is <= than what a user asked for.

Verbosity should also be configurable in settings.
In order to keep the current behavior unless user explicitly changes the settings, I think that what Lukas describes should be verbosity 0 and default should be 1 (or some other value, but one step higher).

PS: Pagination details in #print_record methods should probably be printed only with higher verbosities.

#5 Updated by The Foreman Bot about 1 year ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli/pull/263 added

#6 Updated by The Foreman Bot about 1 year ago

  • Pull request https://github.com/theforeman/hammer-cli-foreman/pull/344 added

#7 Updated by Tomáš Strachota 5 months ago

  • Related to Feature #24110: hammer host list add fields domain_name and last_checkin added

#8 Updated by Martin Bacovsky 4 months ago

  • Related to Feature #24581: Add option to completely suspend progress bar from hammer commands added

#9 Updated by Oleh Fedorenko 2 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF