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

Bad JSON for messages with newlines or quotes #11

Closed
sam701 opened this issue Dec 18, 2016 · 1 comment
Closed

Bad JSON for messages with newlines or quotes #11

sam701 opened this issue Dec 18, 2016 · 1 comment
Assignees
Labels

Comments

@sam701
Copy link

sam701 commented Dec 18, 2016

gommon.log produces erroneous JSON output if the passed message contains newline characters or quotes.

	e.Logger.Info(`hello 
	"world"`)

produces

{"time":"2016-12-18T14:51:44+01:00","level":"INFO","prefix":"echo","file":"main.go","line":"28","message":"hello
	"world""}

This means all panics caught and logged by Echo as JSON are not parsable.

func someHandler(c echo.Context) error {
	panic("abcde")
	return c.String(http.StatusOK, "Hello, World!")
}
@vishr
Copy link
Member

vishr commented Dec 20, 2016

Closed in #9

@vishr vishr closed this as completed Dec 20, 2016
@vishr vishr self-assigned this Dec 20, 2016
@vishr vishr added the bug label Dec 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants