Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hostname in output #98

Open
scottmullaly opened this issue Oct 12, 2016 · 1 comment
Open

Hostname in output #98

scottmullaly opened this issue Oct 12, 2016 · 1 comment

Comments

@scottmullaly
Copy link

With the new number format in front of every command i.e. '01' ,'02', ... it becomes very hard to tell where the command was executed when performing a Capistrano deployment with multiple roles.

It would be much clearer if the hostname was used as in place of the 'number' and makes debugging Puppet errors etc much quicker. Currently I have to tail the full capistrano.log at the same time in my deployments and it seems redundant.

It could be optional and enabled via a Capistrano option.

i.e. basic WIP

def hostname
  host = @delegate_sd_obj.options
  hostname = host[:host].hostname
  "[#{hostname}]"
end

def number
  show_host = fetch(:output_hostname)
  label = format("%02d", @position.to_i + 1)
  label = hostname if show_host
  label
end

Output:

[frontend01.test.host] Info: Retrieving plugin
[frontend03.test.host] Info: Retrieving plugin
[frontend01.test.host] Info: Loading facts in /opt/puppet/var/lib/facter/package_provider.rb
[frontend02.test.host] Info: Retrieving plugin
[frontend02.test.host] Info: Loading facts in /opt/puppet/var/lib/facter/opt_device.rb
@mattbrictson
Copy link
Owner

Hi, thanks for the feature suggestion! My goal with Airbrussh is to be as concise as possible, and while I definitely see the benefit in distinguishing the output of different servers, this does make things a bit more verbose, and potentially a lot of data gets lost by truncation when hostnames are long.

Hiding this behind a feature flag is not something I want to do, either. If we do decide to expand Airbrussh's formatting options, I'd rather make it pluggable than add flags.

I'll leave this issue open to gauge how much demand there is for this feature (readers: please 👍 if you are interested).

For now, can you get by with a monkey patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants