// NewReporter returns a new Reporter instance.
548552
func NewReporter(cfg Config) *HbReporter {
	hbCfg := honeybadger.Configuration{}
	hbCfg.APIKey = cfg.ApiKey
	hbCfg.Env = cfg.Environment
	hbCfg.Endpoint = cfg.Endpoint

	return &HbReporter{honeybadger.New(hbCfg)}
}
996787
func (rc *ReporterConfig) NewReporter(
	serviceName string,
	metrics *jaeger.Metrics,
	logger jaeger.Logger,
) (jaeger.Reporter, error) {
	sender, err := rc.newTransport()
	if err != nil {
		return nil, err
	}
	reporter := jaeger.NewRemoteReporter(
		sender,
		jaeger.ReporterOptions.QueueSize(rc.QueueSize),
		jaeger.ReporterOptions.BufferFlushInterval(rc.BufferFlushInterval),
		jaeger.ReporterOptions.Logger(logger),
		jaeger.ReporterOptions.Metrics(metrics))
	if rc.LogSpans && logger != nil {
		logger.Infof("Initializing logging reporter\n")
		reporter = jaeger.NewCompositeReporter(jaeger.NewLoggingReporter(logger), reporter)
	}
	return reporter, err
}
1246395
func NewProcessReporter(
	scope tally.Scope,
	reportInterval time.Duration,
) Reporter {
	r := new(processReporter)
	r.init(reportInterval, r.metrics.report)

	processScope := scope.SubScope("process")
	r.metrics.NumFDs = processScope.Gauge("num-fds")
	r.metrics.NumFDErrors = processScope.Counter("num-fd-errors")
	r.metrics.pid = os.Getpid()

	return r
}
489034
func RegisterReporter(reporter Reporter) {
	reportersMutex.Lock()
	reporters = append(reporters, reporter)
	reportersMutex.Unlock()
}
835075
func NewWatcher() (*RWatcher, error) {
	fsWatch, err := fsnotify.NewWatcher()
	if err != nil {
		return nil, err
	}

	m := &RWatcher{}
	m.fsnotify = fsWatch
	m.Events = make(chan fsnotify.Event)
	m.Errors = make(chan error)
	m.done = make(chan struct{})

	go m.start()

	return m, nil
}
1343142
func (in *Influx) NewCounter(name string) *Counter {
	return &Counter{
		name: name,
		obs:  in.counters.Observe,
	}
}
126337
func NewNumber(reporter Reporter, value float64) *Number {
	return &Number{makeChain(reporter), value}
}
126426
func NewMockReporter(ctrl *gomock.Controller) *MockReporter {
	mock := &MockReporter{ctrl: ctrl}
	mock.recorder = &MockReporterMockRecorder{mock}
	return mock
}
12052
func (p *graphiteProvider) NewCounter(name string) metrics.Counter {
	return p.g.NewCounter(name)
}
535585
func NewReporterSimple(clock Clock, maxErrors int) *ReporterSimple {
	rs := &ReporterSimple{
		clock:          clock,
		maxErrors:      maxErrors,
		currErrorIndex: -1,
	}

	if maxErrors >= 1 {
		rs.errors = make([]ReportedError, maxErrors)
	}

	return rs
}
1099751
func NewReceiver(w io.Writer, prefix string) *Receiver {

	logger := log.New(w, "", log.LstdFlags)
	r := &Receiver{
		logger: logger,
	}

	// Default options
	r.Active = true
	r.Level = INFO
	r.Format = "[%s] ▶ %s"

	r.SetPrefix(prefix)

	return r
}
673313
func CreateReport(w io.Writer, format, rootPath string, issues []*gosec.Issue, metrics *gosec.Metrics, errors map[string][]gosec.Error) error {
	data := &reportInfo{
		Errors: errors,
		Issues: issues,
		Stats:  metrics,
	}
	var err error
	switch format {
	case "json":
		err = reportJSON(w, data)
	case "yaml":
		err = reportYAML(w, data)
	case "csv":
		err = reportCSV(w, data)
	case "junit-xml":
		err = reportJUnitXML(w, data)
	case "html":
		err = reportFromHTMLTemplate(w, html, data)
	case "text":
		err = reportFromPlaintextTemplate(w, text, data)
	case "sonarqube":
		err = reportSonarqube(rootPath, w, data)
	default:
		err = reportFromPlaintextTemplate(w, text, data)
	}
	return err
}
22614
func NewLogger(stdoutThreshold, logThreshold jww.Threshold, outHandle, logHandle io.Writer, saveErrors bool) *Logger {
	return newLogger(stdoutThreshold, logThreshold, outHandle, logHandle, saveErrors)
}
153139
func newReporter(c *Context) (reporter.Reporter, error) {
	rep, err := config.NewReporterFromUrls(c.StringSlice(FlagReporter))
	if err != nil {
		panic(fmt.Errorf("couldn't create reporter: %#v", err))
	}
	return rep, nil
}
1209729
func NewLogger(prefix string, flags int, handler events.Handler) *log.Logger {
	return log.New(NewWriter(prefix, flags, handler), prefix, flags)
}
331566
func NewLogger(writer io.Writer, fields ...Field) Logger {
	return &writerLogger{writer, Fields(fields)}
}
481501
func NewReporter(interval time.Duration, quit <-chan interface{}) *Reporter {
	return &Reporter{
		interval: interval,
		quit:     quit,
	}
}