]> source.dussan.org Git - gitea.git/commit
Add auto logging of goroutine pid label (#19212)
authorzeripath <art27@cantab.net>
Sat, 26 Mar 2022 20:04:36 +0000 (20:04 +0000)
committerGitHub <noreply@github.com>
Sat, 26 Mar 2022 20:04:36 +0000 (20:04 +0000)
commit70628bd870f54bef2c54c6c67c4f7e5e0481980b
tree3ab5cb854592b758d35236e8ee5aa6bedcafb555
parentc1198284bc4fc54bc5e7cb56cd387b5b955e63f6
Add auto logging of goroutine pid label (#19212)

* Add auto logging of goroutine pid label

This PR uses unsafe to export the hidden runtime_getProfLabel function from the
runtime package and then casts the result to a map[string]string.

We can then interrogate this map to get the pid label from the goroutine allowing
us to log it with any logging request.

Reference #19202

Signed-off-by: Andrew Thornton <art27@cantab.net>
modules/log/groutinelabel.go [new file with mode: 0644]
modules/log/groutinelabel_test.go [new file with mode: 0644]
modules/log/multichannel.go