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

GinkgoLogr does not produce newlines #1170

Closed
erdnas opened this issue Mar 27, 2023 · 2 comments
Closed

GinkgoLogr does not produce newlines #1170

erdnas opened this issue Mar 27, 2023 · 2 comments

Comments

@erdnas
Copy link
Sponsor Contributor

erdnas commented Mar 27, 2023

GinkgoLogr.Info("Something")
GinkgoLogr.Info("Something else")

Outputs:

  Timeline >>
  "level"=0 "msg"="Something""level"=0 "msg"="Something else"
...

I would expect it to have a newline after each log call, for readability.

  Timeline >>
  "level"=0 "msg"="Something"
  "level"=0 "msg"="Something else"
...

If we add a newline to the printf here (or change it to println), we get newlines as desired.

ginkgo/internal/writer.go

Lines 136 to 140 in 9b5078f

func GinkgoLogrFunc(writer *Writer) logr.Logger {
return funcr.New(func(prefix, args string) {
writer.Printf("%s", args)
}, funcr.Options{})
}

erdnas added a commit to erdnas/ginkgo that referenced this issue Mar 27, 2023
erdnas added a commit to erdnas/ginkgo that referenced this issue Mar 27, 2023
erdnas added a commit to erdnas/ginkgo that referenced this issue Mar 27, 2023
@onsi
Copy link
Owner

onsi commented Mar 27, 2023

hey @Nuckal777 can you take a quick look at this. i know you implemented the logr stuff back in #1067 - is the newline being proposed here consistent with the logr spec?

@Nuckal777
Copy link
Contributor

Good catch, we should a \n to the printf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants