// Return short format caller info for panic events, skipping to before the
// panic handler.
481045
func caller(level int) string {
	_, file, line, _ := runtime.Caller(level)
	splits := strings.Split(file, "/")
	filename := splits[len(splits)-1]
	return fmt.Sprintf("%s:%d:", filename, line)
}
500420
func (app *App) PanicHandler(panicHandler func(*Context, interface{})) *App {
	app.defaultRouter.PanicHandler(panicHandler)
	return app
}
383474
func (c Case) ShortString(length int) string {
	return fmt.Sprintf("%s%d [%s, %s]: %s(%s) = %s %s",
		c.Prefix, c.Prec, c.Trap, c.Mode, c.Op,
		join(c.Inputs, ", ", length), trunc(c.Output, length), c.Excep)
}
261378
func panicHandler(w http.ResponseWriter, r *http.Request, rcv interface{}) {
	ctx := r.Context()
	pe := &platform.Error{
		Code: platform.EInternal,
		Msg:  "a panic has occurred",
		Err:  fmt.Errorf("%v", rcv),
	}

	EncodeError(ctx, pe, w)
}
1065979
func panicHandler(w http.ResponseWriter, r *http.Request, rcv interface{}) {
	ctx := r.Context()
	pe := &platform.Error{
		Code: platform.EInternal,
		Msg:  "a panic has occurred",
		Err:  fmt.Errorf("%v", rcv),
	}

	l := getPanicLogger()
	if entry := l.Check(zapcore.ErrorLevel, pe.Msg); entry != nil {
		entry.Stack = string(debug.Stack())
		entry.Write(zap.Error(pe.Err))
	}

	EncodeError(ctx, pe, w)
}
81884
func (me *Logger) Panic(v ...interface{}) {
	me.setFullPrefix(Pfatal)
	me.logger.Panic(v...)
}
324113
func (logs *Logs) Panicf(format string, v ...interface{}) {
	logs.allf(format, v...)
	logs.Flush()
	panic(fmt.Sprintf(format, v...))
}
734824
func (l *Logger) Panicf(format string, args ...interface{}) {
	l.logger().Panicf(format, args...)
}
622695
func Panicf(format string, args ...interface{}) {
	logrus.Warnf(format, args...)
	err := DumpGoProfile()
	if err != nil {
		logrus.Fatal(err)
	}
	DumpHeap()
	os.Exit(6)
}
176254
func (l *Logger) Panic(format string, v ...interface{}) {
	s := fmt.Sprintf(format, v...)
	l.base.SetPrefix(l2s[LFatal])
	l.base.Output(2, s)
	panic(s)
}
1094646
func Panicf(format string, v ...interface{}) {
	std.Fprint(std.flags, LEVEL_CRITICAL, 2, fmt.Sprintf(format, v...), nil)
	panic(v)
}
774467
func (l *Logger) Panic(err error) {
	l.Printer.Printf(prepend(err.Error()))
	panic(err)
}
628011
func GetCallInfo(n ast.Node, ctx *Context) (string, string, error) {
	switch node := n.(type) {
	case *ast.CallExpr:
		switch fn := node.Fun.(type) {
		case *ast.SelectorExpr:
			switch expr := fn.X.(type) {
			case *ast.Ident:
				if expr.Obj != nil && expr.Obj.Kind == ast.Var {
					t := ctx.Info.TypeOf(expr)
					if t != nil {
						return t.String(), fn.Sel.Name, nil
					}
					return "undefined", fn.Sel.Name, fmt.Errorf("missing type info")
				}
				return expr.Name, fn.Sel.Name, nil
			}
		case *ast.Ident:
			return ctx.Pkg.Name(), fn.Name, nil
		}
	}
	return "", "", fmt.Errorf("unable to determine call info")
}
1325428
func Panic(err error, msgs ...string) {
	if err != nil {
		if len(msgs) > 0 {
			panic(strings.Join(msgs, ",") + err.Error())
		} else {
			panic(err)
		}
	}
}
209488
func (l *Logger) Panicf(format string, v ...interface{}) {
	l.Fprint(l.flags, LEVEL_CRITICAL, 2, fmt.Sprintf(format, v...), nil)
	panic(v)
}
778009
func Panicf(format string, v ...interface{}) {
	s := fmt.Sprintf(format, v...)
	log.Output(2, s)
	panic(s)
}
790393
func (l *Logger) Panic() *Event {
	return l.newEvent(PanicLevel, func(msg string) { panic(msg) })
}