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

proposal: have go errors always start by a whitespace from the 2nd line #30658

Closed
sylr opened this issue Mar 7, 2019 · 2 comments
Closed

proposal: have go errors always start by a whitespace from the 2nd line #30658

sylr opened this issue Mar 7, 2019 · 2 comments

Comments

@sylr
Copy link

sylr commented Mar 7, 2019

There are a number of logs tools (e.g.: splunk) that allows grouping stacktraces into a single event based on the fact all the lines starting from the 2nd start with a space (like java stacktraces).

So it would be nice it go stacktraces could do the same:

panic: a problem

goroutine 1 [running]:
main.main()
	/tmp/sandbox799394689/main.go:15 +0x40

to (. instead of space for visibility)

panic: a problem
.
.goroutine 1 [running]:
.main.main()
.	/tmp/sandbox799394689/main.go:15 +0x40
@ianlancetaylor
Copy link
Contributor

This seems very likely to break existing programs that parse the panic output of other programs. I recall seeing code like that though I can't find it at the moment. While we could make this kind of change, it's hard to believe that it's worth doing at this point. It's easy enough to process the output the way some other tool expects.

@andybons andybons changed the title Have go errors always start by a whitespace from the 2nd line proposal: have go errors always start by a whitespace from the 2nd line Mar 9, 2019
@gopherbot gopherbot added this to the Proposal milestone Mar 9, 2019
@ianlancetaylor
Copy link
Contributor

Thanks, but making this change as-is would break too many people, and it's possible to add a wrapper to get the desired format.

@golang golang locked and limited conversation to collaborators Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants