Allow configuring (vs just toggling) v1's output line prefix
See original GitHub issueDescription
It seems that the output prefix should be a bit more flexible than it currently is. The current format is:
[hoststring] Message
This should be flexible, meaning both format as well as the ability to turn it off, or make it print one line per host/task combo. (That particular aspect has been spun off into #281.)
An ideal situation would be to use python’s built-in template strings. (or to be very forward thinking format strings, but those require 2.6). The template can be put in evn.output.prefix or similar. Using the templates it is easy to just define output format based on exposed variables.
These could include:
- hostname
- hoststring
- comand output signifier [1][2]
- time [1]
- other stuff
It could also include color code formatting.
[1] some variables will need to have a helper variable, e.g. strftime format for time [2] output signifier could be something simple like a ** making the output something like:
[hostname] Log msg
[hostname] ** output from cmd
An example format string (with helpers) could look like:
env.output.prefix = "[${hostname} - ${time}] ${cmd_sig}"
env.output.timeformat = "H:M"
env.output.cmd_sig = "**"
resulting in:
[www1.foo.com - 17:05] Executing hostname
[www1.foo.com - 17:05] ** www1.foo.com
Originally submitted by Erich Heine (sophacles) on 2010-05-14 at 05:56pm EDT
Attachments
Relations
Issue Analytics
- State:
- Created 12 years ago
- Reactions:2
- Comments:21 (13 by maintainers)
Top GitHub Comments
It would be good to have the ability to turn the prefix off also. For example, I’m using this task to connect to a remote Django shell and try many things on the server directly:
Right now, I have a lot of prefix information that I don’t need and it’s just noise.
On second thought, just make it more obvious that this would be a nice small feature add for the 1.x line.