Project

General

Profile

Actions

Bug #14725

closed

Verbose mode does not work and is inconsistent

Added by Lukas Zapletal almost 8 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Category:
Hammer core
Target version:
-
Fixed in Releases:
Found in Releases:
In Kanboard:

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 4 (1 open3 closed)

Related to Hammer CLI - Tracker #14914: Tracker for output related issuesClosed

Actions
Related to Hammer CLI - Feature #24110: hammer host list add fields domain_name and last_checkinNewAditi PuntambekarActions
Related to foreman-tasks - Feature #24581: Add option to completely suspend progress bar from hammer commandsClosedActions
Related to Hammer CLI - Bug #26453: undefined method `meta' error seen when using --output table option with hammer cliClosedOri RabinActions
Actions #1

Updated by Tomáš Strachota almost 8 years ago

Actions #2

Updated by Tomáš Strachota over 7 years ago

  • Target version set to 115
Actions #3

Updated by Oleh Fedorenko over 6 years ago

  • Status changed from New to Assigned
  • Assignee set to Oleh Fedorenko
Actions #4

Updated by Tomáš Strachota over 6 years 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.

Actions #5

Updated by The Foreman Bot over 6 years ago

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

Updated by The Foreman Bot over 6 years ago

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

Updated by Tomáš Strachota over 5 years ago

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

Updated by Martin Bacovsky over 5 years ago

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

Updated by Oleh Fedorenko over 5 years ago

  • Status changed from Ready For Testing to Closed
Actions #10

Updated by Ori Rabin about 5 years ago

  • Related to Bug #26453: undefined method `meta' error seen when using --output table option with hammer cli added
Actions #11

Updated by Martin Bacovsky over 4 years ago

  • Triaged set to No
  • Fixed in Releases hammer-cli-0.15.0 added
Actions

Also available in: Atom PDF