observer

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgMissingProvider = "provider '%s' required"
)

Variables

This section is empty.

Functions

func Log

func Log(msg string, keyValuePairs ...string)

func LogWithLevel

func LogWithLevel(lvl provider.Severity, msg string, keyValuePairs ...string)

func Meter

func Meter(ctx context.Context, metric string, args ...string)

Meter logs args to a metrics log from where the values can be aggregated and analyzed.

func Provider

func Provider(providerType provider.ProviderType) (interface{}, bool)

Provider returns the registered provider instance if it is defined. The bool flag is set to true if there is a provider and false otherwise.

func ReportError

func ReportError(e error)

ReportError reports error e using the current platform's error reporting provider

Types

type Observer

type Observer struct {
	// contains filtered or unexported fields
}

func DefaultObserver

func DefaultObserver() *Observer

DefaultObserver returns the current default observer.

func Init

func Init(ctx context.Context, opts ...provider.ProviderConfig) (*Observer, error)

Init creates a new global observer instance and configures it with providers

func Register

func Register(o *Observer) *Observer

Register makes o the new default observer

func (*Observer) RegisterProviders

func (p *Observer) RegisterProviders(ignoreExists bool, opts ...provider.ProviderConfig) error

RegisterProviders registers one or more providers. An existing provider will be overwritten if ignoreExists is true, otherwise the function returns an error.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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