Logging for Concurrent Go Programs

Image by PublicDomainPictures from Pixabay

Log is an important part for debugging.

Troubleshooting and debugging of a concurrent program is difficult. In Golang, this getting even worse as officially the Goroutine’s id is not exposed for access.

But its kind of well known and spread out that the goroutine id can be obtained using some go runtime stack information. This technique can even be found in the golang source

--

--

Cloud explorer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store