1
1
mirror of https://github.com/walles/moar.git synced 2024-11-22 03:14:56 +03:00
moar/twin/panicHandler.go
2024-08-12 21:47:46 +02:00

19 lines
388 B
Go

package twin
// NOTE: This file should be identical to m/panicHandler.go
import (
log "github.com/sirupsen/logrus"
)
func panicHandler(goroutineName string, recoverResult any, stackTrace []byte) {
if recoverResult == nil {
return
}
log.WithFields(log.Fields{
"panic": recoverResult,
"stackTrace": string(stackTrace),
}).Error("Goroutine panicked: " + goroutineName)
}