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

E2E: Logf() always adding a newline to the message #57102

Closed
php-coder opened this issue Dec 12, 2017 · 6 comments · Fixed by #57583
Closed

E2E: Logf() always adding a newline to the message #57102

php-coder opened this issue Dec 12, 2017 · 6 comments · Fixed by #57583

Comments

@php-coder
Copy link
Contributor

@php-coder php-coder commented Dec 12, 2017

Is this a BUG REPORT or FEATURE REQUEST?:
/kind bug

What happened:
Logf() is always appending a new line to its message:

func log(level string, format string, args ...interface{}) {
fmt.Fprintf(GinkgoWriter, nowStamp()+": "+level+": "+format+"\n", args...)
}
func Logf(format string, args ...interface{}) {
log("INFO", format, args...)
}

In some places of code, the message is already has a newline character and it leads to doubled new lines in the logs.

What you expected to happen:
I'm not sure what is the correct behavior here. One of the options could be to append a new line conditionally.

@php-coder
Copy link
Contributor Author

@php-coder php-coder commented Dec 12, 2017

/sig testing

@MorrisLaw
Copy link
Member

@MorrisLaw MorrisLaw commented Dec 12, 2017

@php-coder I'm new to Kubernetes and would like to start contributing. Is it ok if I assign myself this issue?

@MorrisLaw
Copy link
Member

@MorrisLaw MorrisLaw commented Dec 12, 2017

/assign MorrisLaw

@k8s-ci-robot
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented Dec 12, 2017

@MorrisLaw: GitHub didn't allow me to assign the following users: MorrisLaw.

Note that only kubernetes members can be assigned.

In response to this:

/assign MorrisLaw

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@MorrisLaw
Copy link
Member

@MorrisLaw MorrisLaw commented Dec 12, 2017

I can't assign this to myself, as I am not a member yet. But I am still going to take this issue.

@timothysc timothysc self-assigned this Dec 12, 2017
@timothysc
Copy link
Member

@timothysc timothysc commented Dec 12, 2017

I'll help him on reviews so assigning.

k8s-github-robot pushed a commit that referenced this issue Feb 22, 2018
Automatic merge from submit-queue (batch tested with PRs 60158, 60156, 58111, 57583, 60055). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Bugfix/logf newline

**What this PR does / why we need it**:
Removes all redundant new lines being passed into the `Logf()` function. This involved going through code in both `test/e2e` and `test/e2e_node`, finding the newline redundancies in calls to `Logf()` and removing them.

**Which issue(s) this PR fixes**:
Fixes [#57102](#57102)

**Release note**:

```release-note
NONE
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants