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

What goroutine i should to log? #5

Open
rugleb opened this issue Sep 28, 2022 · 0 comments
Open

What goroutine i should to log? #5

rugleb opened this issue Sep 28, 2022 · 0 comments

Comments

@rugleb
Copy link

rugleb commented Sep 28, 2022

Which gourotine i should to log, when recovering from panic?

Example:

	if err := recover(); err != nil {
		stack := debug.Stack()
		goroutines, _ := gostackparse.Parse(bytes.NewReader(stack))
		log(goroutines[0]) // ?
	}

Potentially, the number of goroutines can be more than one. Which one do I need to use to get the current call stack?

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

1 participant