Documentation
¶
Index ¶
- func DumpPreviousStacktrace()
- func DumpSignalTo(fd int)
- func DumpStacktraceTo(name string)
- func Notify(c chan<- os.Signal, sigs ...os.Signal)
- func PreviousStacktrace() string
- func SetSigInvokeChain(to os.Signal, wait os.Signal, sleepInSeconds int, froms ...os.Signal)
- func Signum(sig os.Signal) int
- type OnSignalHandler
- type OnSignalHandlerFunc
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpPreviousStacktrace ¶
func DumpPreviousStacktrace()
DumpPreviousStacktrace dumps the previous human readable stacktrace to fd, which is set by SetSignalDumpToFd.
func DumpSignalTo ¶
func DumpSignalTo(fd int)
DumpSignalTo redirects log to fd, -1 if not set; muted if < 0.
func DumpStacktraceTo ¶
func DumpStacktraceTo(name string)
DumpStacktraceTo set dump file path of stacktrace when signal is triggered "*.stacktrace.dump" under a temp dir if not set.
func Notify ¶
Notify act as signal.Notify, which invokes the Go signal handler. https://godoc.org/os/signal#hdr-Go_programs_that_use_cgo_or_SWIG Notify must be called again when one sig is called on windows system as windows is based on signal(), which will reset sig's handler to SIG_DFL before sig's handler is called While unix-like os will remain sig's handler always.
func PreviousStacktrace ¶
func PreviousStacktrace() string
PreviousStacktrace returns a human readable stacktrace
func SetSigInvokeChain ¶
SetSigInvokeChain sets a rule to raise signal to {to} and wait until {wait}, done with sleep {sleepInSeconds}s
Types ¶
type OnSignalHandler ¶
type OnSignalHandlerFunc ¶
func (OnSignalHandlerFunc) OnSignal ¶
func (f OnSignalHandlerFunc) OnSignal(signum os.Signal)
Directories
¶
Path | Synopsis |
---|---|
Package cgo contains runtime support for code generated by the cgo tool.
|
Package cgo contains runtime support for code generated by the cgo tool. |