File: panicHandler.go

package info (click to toggle)
moor 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 16,112 kB
  • sloc: sh: 174; ansic: 12; xml: 6; makefile: 5
file content (18 lines) | stat: -rw-r--r-- 388 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)
}