cat

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderRootId   = "_catRootMessageId"
	HeaderParentId = "_catParentMessageId"
	HeaderChildId  = "_catChildMessageId"
)

Variables

View Source
var DefaultOption = Option{Logger: logger.NewLogger(os.Stdout)}

Functions

func Init

func Init(domain string, opt Option) error

func LogError

func LogError(err error, args ...string)

func LogErrorWithCategory

func LogErrorWithCategory(err error, category string)

func LogEvent

func LogEvent(mtype, name string, args ...string)

func LogMetricForCount

func LogMetricForCount(name string, args ...int)

func LogMetricForDuration

func LogMetricForDuration(name string, duration time.Duration)

func LogRemoteCallClient added in v1.0.4

func LogRemoteCallClient(t message.Transactor)

func LogRemoteCallServer added in v1.0.4

func LogRemoteCallServer(ctx *message.Context, t message.Transactor)

func MessageContextFromMetadata added in v1.0.5

func MessageContextFromMetadata(md metadata.MD) *message.Context

func MessageContextFromRequest added in v1.0.5

func MessageContextFromRequest(r *http.Request) *message.Context

func NewCompletedTransactionWithDuration

func NewCompletedTransactionWithDuration(mtype, name string, duration time.Duration)

func NewEvent

func NewEvent(mtype, name string) message.Messager

func NewTransaction

func NewTransaction(mtype, name string) message.Transactor

func Shutdown

func Shutdown()

func StartEvent added in v1.0.5

func StartEvent(ctx context.Context, mtype, name string) message.Messager

func StartTransaction added in v1.0.5

func StartTransaction(ctx context.Context, mtype, name string) message.Transactor

func TransactionFromContext added in v1.0.5

func TransactionFromContext(ctx context.Context) message.Transactor

func TransactionWithContext added in v1.0.5

func TransactionWithContext(ctx context.Context, t message.Transactor) context.Context

Types

type MetricHelper

type MetricHelper interface {
	AddTag(key, val string) MetricHelper
	Count(int)
	Duration(time.Duration)
}

func NewMetricHelper

func NewMetricHelper(name string) MetricHelper

type Option added in v1.0.2

type Option struct {
	Logger *zerolog.Logger
}

Jump to

Keyboard shortcuts

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