// New creates an Mtail from the supplied Options. func New(o Options) (*Mtail, error) { m := &Mtail{ lines: make(chan string), webquit: make(chan struct{}), o: o} err := m.InitLoader() if err != nil { return nil, err } m.e, err = exporter.New(exporter.Options{Store: &m.store}) if err != nil { return nil, err } return m, nil }
// New creates an Mtail from the supplied Options. func New(o Options) (*Mtail, error) { store := o.Store if store == nil { store = metrics.NewStore() } m := &Mtail{ lines: make(chan string), store: store, webquit: make(chan struct{}), o: o} err := m.InitLoader() if err != nil { return nil, err } m.e, err = exporter.New(exporter.Options{Store: m.store}) if err != nil { return nil, err } return m, nil }