-
Notifications
You must be signed in to change notification settings - Fork 263
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
Fixedwidth during stream of CF events #204
base: master
Are you sure you want to change the base?
Conversation
// Format reads the struct tag `width:"<width>,<space>"` | ||
// further marshaling into structured field | ||
func (s *stackEvent) format(fil filters) []byte { | ||
tp := reflect.TypeOf(s).Elem() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would be possible to add table unit tests for that method which seems central? It would help the understanding, document a bit the look of the output, put non regression in place and allow future safe refactoring.
I do not have the answer, I am just wondering.
Tailers are experimental and are not advertised on the sub commands listing, so we have more leeway in their implementation. So we shall review that and it could make it into the 0.1.10 that is due in the next 2 days. Otherwise thanks for the work @trane9991 ! |
This PR adds the custom solution for streaming CloudFormation events into a structured table with a column of fixed width, to prevent "jumping"
Before:
![before](https://user-images.githubusercontent.com/9948629/38522264-b8d8aba6-3c50-11e8-8e63-6db94769754c.png)
After:
![after](https://user-images.githubusercontent.com/9948629/38522263-b8bacc94-3c50-11e8-9878-1a981f1c03e6.png)
The new approach uses Reflection and pretty complex but seems to work well.