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

Commands can Opt-out of Logging #116

Merged
merged 2 commits into from
May 22, 2020
Merged

Commands can Opt-out of Logging #116

merged 2 commits into from
May 22, 2020

Conversation

kensipe
Copy link
Member

@kensipe kensipe commented May 22, 2020

Provides the ability for a command to opt-out of logging.

This is useful when:

  1. log may have sensitive information
  2. log is too noisy due to a specific command

Co-authored-by: Marcin Owsiany mowsiany@D2iQ.com
Signed-off-by: Ken Sipe kensipe@gmail.com

Fixes #

Signed-off-by: Ken Sipe <kensipe@gmail.com>
Copy link
Member

@porridge porridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have two problems with the field name:

  1. it is two words joined without camelCasing makint inconsistent and hard to read
  2. without reading the code it sounds as if this is going to not log the running command [echo foo] message. We should mention that it's the stderr/out output that is not going to be logged.
  3. I feel that the word ignore is more suited to situations where we do not react to some event (such as with ignoreFailure above. Here we kind of spontaneously decide to not do something, so I think skip is better.

@@ -114,6 +114,8 @@ type Command struct {
Background bool `json:"background"`
// Override the TestSuite timeout for this command (in seconds).
Timeout int `json:"timeout"`
// If set, the command is NOT logged. Useful to sensitive logs or to reduce noise.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// If set, the command is NOT logged. Useful to sensitive logs or to reduce noise.
// If set, the OUTPUT from the command is NOT logged. Useful to sensitive logs or to reduce noise.

@@ -114,6 +114,8 @@ type Command struct {
Background bool `json:"background"`
// Override the TestSuite timeout for this command (in seconds).
Timeout int `json:"timeout"`
// If set, the command is NOT logged. Useful to sensitive logs or to reduce noise.
IgnoreLog bool `json:"ignorelog"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
IgnoreLog bool `json:"ignorelog"`
SkipOutputLog bool `json:"skipOutputLog"`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether this should be skipLogOutput or skipOutputLog...

Copy link
Member

@ANeumann82 ANeumann82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with both namings, tbh.

I wonder if it makes sense to separate stdout and stderr though. It might be hard to debug command failures if the output is always skipped...

@kensipe
Copy link
Member Author

kensipe commented May 22, 2020

thanks @porridge ! I struggled with the naming a bit as well... and prefer your suggestions.

thanks @ANeumann82 . If debugging is needed they can always remove the flag. Your comment gave me pause to consider skipStdout and skipStderr. It seems like an extra burden to me... if you have a noising output... it shouldn't be hard to turn it off.

Signed-off-by: Ken Sipe <kensipe@gmail.com>
Copy link
Member

@porridge porridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@kensipe kensipe merged commit 8f3d766 into master May 22, 2020
@kensipe kensipe deleted the ken/command-output-opt-out branch May 22, 2020 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants