code: func extractError(entry *logrus.Entry) ([]uintptr, error) {
  	var trace []uintptr
  	fields := entry.Data
  
  	type stackTracer interface {
  		StackTrace() errors.StackTrace
  	}
  
  	for _, f := range wellKnownErrorFields {
  		e, ok := fields[f]
  		if !ok {
  			continue
  		}
  		err, ok := e.(error)
  		if !ok {
  			continue
  		}
  
  		cause := errors.Cause(err)
  		tracer, ok := err.(stackTracer)
  		if ok {
  			return copyStackTrace(tracer.StackTrace()), cause
  		}
  		return trace, cause
  	}
  
  	// when no error found, default to the logged message.
  	return trace, fmt.Errorf(entry.Message)
  }
docs: // extractError attempts to extract an error from a well known field, err or error