code: func LoggingAndRecovery(c lars.Context) {
  
  	t1 := time.Now()
  
  	defer func() {
  		if err := recover(); err != nil {
  			trace := make([]byte, 1<<16)
  			n := runtime.Stack(trace, true)
  			log.Printf(" %srecovering from panic: %+v\nStack Trace:\n %s%s", ansi.Red, err, trace[:n], ansi.Reset)
  			HandlePanic(c, trace[:n])
  			return
  		}
  	}()
  
  	c.Next()
  
  	color := status
  	res := c.Response()
  	req := c.Request()
  	code := res.Status()
  
  	switch {
  	case code >= http.StatusInternalServerError:
  		color = status500
  	case code >= http.StatusBadRequest:
  		color = status400
  	case code >= http.StatusMultipleChoices:
  		color = status300
  	}
  
  	t2 := time.Now()
  
  	log.Printf("%s %d %s[%s%s%s] %q %v %d\n", color, code, ansi.Reset, color, req.Method, ansi.Reset, req.URL, t2.Sub(t1), res.Size())
  }
docs: // LoggingAndRecovery handle HTTP request logging + recovery