signals

package
v0.0.0-...-2ef43f2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CrashOnError = false

CrashOnError causes a coredump to be produced when an internal error occurs or a fatal signal is received.

Functions

func Backtrace

func Backtrace()

Backtrace writes a multi-line backtrace to the logger.

func Die

func Die()

Die causes a backtrace to be produced. If CrashOnError is set a coredump will be produced, else the program will exit.

func FatalSignal

func FatalSignal(sig syscall.Signal) bool

FatalSignal returns true if the specified signal should cause the program to abort.

func HandlePanic

func HandlePanic()

HandlePanic writes a message to the logger and then calls Die().

func HandledSignals

func HandledSignals() []syscall.Signal

HandledSignals returns a list of signals the package can deal with.

func NonFatalSignal

func NonFatalSignal(sig syscall.Signal) bool

NonFatalSignal returns true if the specified signal should simply cause the program to Backtrace() but continue running.

func SetLogger

func SetLogger(logger *logrus.Entry)

SetLogger sets the custom logger to be used by this package. If not called, the package will create its own logger.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL