Documentation
¶
Index ¶
- func ActivateDebug(logger Logger) func()
- func EnableLogsDebug() *logs.Logger
- func GlobalLogs() *logs.Logger
- func RecoverAsError(name string, errp *error)
- func SDKGoRecover(engine string)
- func SafeGo(name string, fn func())
- func SafeRun(name string, fn func())
- func StartupLine(status, component, detail string) string
- func StartupOK(component, detail string) string
- func SuppressGlobalNonErrors() func()
- type LogConfig
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActivateDebug ¶
func ActivateDebug(logger Logger) func()
func EnableLogsDebug ¶
func GlobalLogs ¶
func RecoverAsError ¶ added in v0.3.0
RecoverAsError is designed for tool Execute methods. Call as:
defer telemetry.RecoverAsError("toolname", &err)
It converts a panic into a returned error so the process stays alive.
func SDKGoRecover ¶
func SDKGoRecover(engine string)
SDKGoRecover recovers from a panic inside a goroutine that processes SDK results. It logs the panic; the deferred close(out) in the caller signals the consumer that the stream ended.
func SafeGo ¶
func SafeGo(name string, fn func())
SafeGo launches a goroutine with automatic panic recovery. On panic the stack is logged and the goroutine exits cleanly.
func SafeRun ¶
func SafeRun(name string, fn func())
SafeRun executes fn synchronously with panic recovery. On panic the stack is logged and SafeRun returns normally, so the caller (e.g. a worker loop) can continue processing.
func StartupLine ¶ added in v0.3.0
func SuppressGlobalNonErrors ¶
func SuppressGlobalNonErrors() func()
Types ¶
Click to show internal directories.
Click to hide internal directories.