code: func NewWALWatcher(logger log.Logger, name string, writer writeTo, walDir string) *WALWatcher {
  	if logger == nil {
  		logger = log.NewNopLogger()
  	}
  	return &WALWatcher{
  		logger: logger,
  		writer: writer,
  		walDir: path.Join(walDir, "wal"),
  		name:   name,
  		quit:   make(chan struct{}),
  		done:   make(chan struct{}),
  
  		maxSegment: -1,
  	}
  }
docs: // NewWALWatcher creates a new WAL watcher for a given WriteTo.