code: func (s *Snapshotter) appendLine(l string) error {
  	defer metrics.MeasureSince([]string{"serf", "snapshot", "appendLine"}, time.Now())
  
  	n, err := s.buffered.WriteString(l)
  	if err != nil {
  		return err
  	}
  
  	// Check if we should flush
  	now := time.Now()
  	if now.Sub(s.lastFlush) > flushInterval {
  		s.lastFlush = now
  		if err := s.buffered.Flush(); err != nil {
  			return err
  		}
  	}
  
  	// Check if a compaction is necessary
  	s.offset += int64(n)
  	if s.offset > s.snapshotMaxSize() {
  		return s.compact()
  	}
  	return nil
  }
docs: // appendLine is used to append a line to the existing log