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
Allow configuring (vs just toggling) v1's output line prefix #163
Comments
|
Erich Heine (sophacles) posted: OK, so formatting fail... it should read: These could include:
on 2010-05-14 at 05:58pm EDT |
|
Jeff Forcier (bitprophet) posted: Tweaked formatting a bit for you. Thanks for making the ticket. I agree that the forward compatible string formatting would be best but I don't want to rely on 2.6 yet so that's unfortunately out. Amusingly a translated format string brings us back to the older magical string interpolation, but since it's required for dynamic stuff like this and is limited to a single spot of the code, may not be so bad. An alternative is a call chain, an array of callbacks, e.g. it might start out as on 2010-05-14 at 07:28pm EDT |
|
Erich Heine (sophacles) posted: Nice! I like it anytime callbacks can be incorporated anywhere. The thing we are discussing at this point tho is an "almost but not quite" version of python's logging module. Perhaps that should be looked at for either inspiration or instead of a one-off. Refreshing myself on the module, I notice there are a few things that could help in other places too. There are handlers and formatters, and it supports the notion of levels, so theoretically this could do everything fabric already aims to do regarding output. The biggest problem would be prompting, but if the chain of events goes (remote process output)->(paramiko.stdout/stderr) -> (prompt/expect handling) -> logger it may not be a big deal. Anyway, some food for thought for the morning. on 2010-05-15 at 11:25am EDT |
|
Jeff Forcier (bitprophet) posted: Good point. We do have tickets open that refer to using the logging module, and I think some of them did mention using it for stdout as well as to-file logging. Will add them as related items in case that has any bearing on this specific issue (I haven't really played with the logging module much, but given how logs are, I do expect it'll have prefix options...) on 2010-05-15 at 02:02pm EDT |
|
Jeff Forcier (bitprophet) posted: Keep in mind that a fully empty prefix should also be easy to effect, though offhand that should simply be an empty-string prefix setting, so not a big deal. For example, now that #7 is basically done, fully interactive stuff is going to want prefixing turned off completely lest it look terribly ugly or even broken. on 2010-06-21 at 10:34pm EDT |
|
Jeff Forcier (bitprophet) posted: Attaching a related patch from Pawel Michalski, based off of the 0.9.3 codebase. on 2011-01-16 at 09:23am EST |
|
Jeff Forcier (bitprophet) posted: BUNP on 2011-06-21 at 08:33pm EDT |
|
What's required to see this merged into master? |
|
👍 for this - especially the customizable datetime prefix bits. |
|
The main hurdle is that changes to critical parts of the codebase (such as this) aren't typically worth the support/backwards-compat burden, when an in-the-pipe rewrite with this sort of flexibility in mind is coming (Fab 2). The chance of this (if it were cleaned up for current master & merged) causing issues is relatively high :( See also the roadmap. |
|
Allowing this to be configurable would be nice. I currently re-run commands on the same host but specifying different shell variables to select different databases. It would be useful if I could configure it to show |
|
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. |
|
Well, I found the |
|
One impl of this is in #1140. |
|
Currently |
|
That looks like a typo, should be |
|
Is there any way to put the boolean value in fabricic file ? |
|
@anhvanngouiowa No, that's a limitation of fabricrc files :( strings only. FWIW version 2.0 will have a much less awful config mechanism allowing this sort of setting to be configured usefully. |
|
I also need a way to customise the output. When this patch is going to be merged into upstream ? |
|
Roll this into pyinvoke/invoke#15 |
|
On second thought, just make it more obvious that this would be a nice small feature add for the 1.x line. |
Description
It seems that the output prefix should be a bit more flexible than it currently is. The current format is:
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:
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:
An example format string (with helpers) could look like:
resulting in:
Originally submitted by Erich Heine (sophacles) on 2010-05-14 at 05:56pm EDT
Attachments
Relations
The text was updated successfully, but these errors were encountered: