code: func (hook LogrusStackHook) Fire(entry *logrus.Entry) error {
  	var skipFrames int
  	if len(entry.Data) == 0 {
  		// When WithField(s) is not used, we have 8 logrus frames to skip.
  		skipFrames = 8
  	} else {
  		// When WithField(s) is used, we have 6 logrus frames to skip.
  		skipFrames = 6
  	}
  
  	var frames stack.Stack
  
  	// Get the complete stack track past skipFrames count.
  	_frames := stack.Callers(skipFrames)
  
  	// Remove logrus's own frames that seem to appear after the code is through
  	// certain hoops. e.g. http handler in a separate package.
  	// This is a workaround.
  	for _, frame := range _frames {
  		if !strings.Contains(frame.File, "github.com/sirupsen/logrus") {
  			frames = append(frames, frame)
  		}
  	}
  
  	if len(frames) > 0 {
  		// If we have a frame, we set it to "caller" field for assigned levels.
  		for _, level := range hook.CallerLevels {
  			if entry.Level == level {
  				entry.Data["caller"] = frames[0]
  				break
  			}
  		}
  
  		// Set the available frames to "stack" field.
  		for _, level := range hook.StackLevels {
  			if entry.Level == level {
  				entry.Data["stack"] = frames
  				break
  			}
  		}
  	}
  
  	return nil
  }
docs: // Fire is called by logrus when something is logged.