observer

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultLogId = "default"
	MetricsLogId = "metric"
	ValuesLogId  = "values"

	LevelDebug Severity = iota
	LevelInfo
	LevelNotice
	LevelWarn
	LevelError
	LevelAlert

	TypeLogger        cloudlib.ProviderType = 10
	TypeErrorReporter cloudlib.ProviderType = 11
	TypeMetrics       cloudlib.ProviderType = 12
)

Variables

This section is empty.

Functions

func DisableLogging

func DisableLogging()

func EnableLogging

func EnableLogging()

func Init

func Init()

func Instance

func Instance() *cloudlib.Provider

func Log

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

func LogWithLevel

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

func Meter

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

func NewConfig

func NewConfig(opts ...cloudlib.ProviderConfig) (*cloudlib.Provider, error)

func NewDefaultProvider

func NewDefaultProvider() interface{}

a default provider that does nothing but prevents NPEs in case someone forgets to actually initializa the 'real' provider

func ReportError

func ReportError(e error) error

func UpdateConfig

func UpdateConfig(opts ...cloudlib.ProviderConfig) (*cloudlib.Provider, error)

Types

type ErrorReportingProvider

type ErrorReportingProvider interface {
	ReportError(error) error
}

type LoggingProvider

type LoggingProvider interface {
	Log(string, ...string)
	LogWithLevel(Severity, string, ...string)

	EnableLogging()
	DisableLogging()
}

type MetricsProvider

type MetricsProvider interface {
	Meter(ctx context.Context, metric string, vals ...string)
}

type Severity

type Severity int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳