debug.go 481 B

1234567891011121314151617181920
  1. package common
  2. import (
  3. "fmt"
  4. "os"
  5. "runtime"
  6. "runtime/debug"
  7. )
  8. func Report(extra ...interface{}) {
  9. fmt.Fprintln(os.Stderr, "You've encountered a sought after, hard to reproduce bug. Please report this to the developers <3 https://github.com/ethereum/go-ethereum/issues")
  10. fmt.Fprintln(os.Stderr, extra...)
  11. _, file, line, _ := runtime.Caller(1)
  12. fmt.Fprintf(os.Stderr, "%v:%v\n", file, line)
  13. debug.PrintStack()
  14. fmt.Fprintln(os.Stderr, "#### BUG! PLEASE REPORT ####")
  15. }