Standard library / runtime/debug

debug.SetTraceback()

Sets the runtime crash traceback verbosity, subject to the startup minimum. It does not change ordinary recovered panic behavior. Expected stdout: 'configured\n'.

Formal Syntax & Structure

go syntaxgo
func SetTraceback(level string)

Parameters & Attributes

NameTypeDescription
levelstringTraceback verbosity, e.g. single, all, system, or crash.

Working Example

Example Snippetgo
package main
import (  "fmt"  "runtime/debug")
func main() { debug.SetTraceback("single"); fmt.Println("configured") }
Go Reference