v2

package module
v2.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

v2 implements the v2 version of the go-reporter package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Errors represents the errors reporter configuration.
	Errors *errors.Config `yaml:"errors"`

	// Logging represents the logging reporter configuration.
	Logging *logging.Config `yaml:"logging"`

	// Metrics represents the metrics reporter configuration.
	Metrics *metrics.Config `yaml:"metrics"`

	// Debug represents a flags indicating whether to enable internal reporter activity logging.
	// This is mainly for debug purposes.
	Debug bool `yaml:"debug"`
}

type Reporter

type Reporter struct {
	Errors  *errors.Reporter
	Logging *logging.Reporter
	Metrics *metrics.Reporter

	*debug.D
	// contains filtered or unexported fields
}

Reporter represents a reporter instance.

func New

func New(config *Config) (*Reporter, error)

New returns a new reporter instance.

func (*Reporter) Config

func (r *Reporter) Config() *Config

Config returns the reporter initial configuration.

func (*Reporter) Crit

func (r *Reporter) Crit(msg string, ctx ...interface{})

Crit is a convenience wrapper around Reporter.Logging.Crit(). It is effective only if the reporter has its logging reporter configured.

func (*Reporter) Debug

func (r *Reporter) Debug(msg string, ctx ...interface{})

Debug is a convenience wrapper around Reporter.Logging.Debug(). It is effective only if the reporter has its logging reporter configured.

func (*Reporter) Error

func (r *Reporter) Error(msg string, ctx ...interface{})

Error is a convenience wrapper around Reporter.Logging.Error(). It is effective only if the reporter has its logging reporter configured.

func (*Reporter) Info

func (r *Reporter) Info(msg string, ctx ...interface{})

Info is a convenience wrapper around Reporter.Logging.Info(). It is effective only if the reporter has its logging reporter configured.

func (*Reporter) Start

func (r *Reporter) Start(ctx context.Context) error

Start starts the configured reporters.

func (*Reporter) Stop

func (r *Reporter) Stop(ctx context.Context) error

Stop stops the configured reporters.

func (*Reporter) Warn

func (r *Reporter) Warn(msg string, ctx ...interface{})

Warn is a convenience wrapper around Reporter.Logging.Warn(). It is effective only if the reporter has its logging reporter configured.

Directories

Path Synopsis
errors implements an errors/crashes reporter.
errors implements an errors/crashes reporter.
internal
logging implements a logs reporter.
logging implements a logs reporter.
metrics implements a metrics reporter.
metrics implements a metrics reporter.
prometheus
prometheus implements a Prometheus-compatible metrics exporter.
prometheus implements a Prometheus-compatible metrics exporter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL