blog

package
v0.0.0-...-6c424d2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NoopTags = &noopTags{}
)

Functions

func DefaultDeciderMethod

func DefaultDeciderMethod(methodName string, err error) bool

func DefaultErrorToCode

func DefaultErrorToCode(err error) codes.Code

func SetInContext

func SetInContext(ctx context.Context, tags Tags) context.Context

Types

type ClientLoggingDecider

type ClientLoggingDecider func(ctx context.Context, methodName string) bool

type Decider

type Decider func(methodName string, err error) bool

type ErrorToCode

type ErrorToCode func(err error) codes.Code

type JsonPbMarshaler

type JsonPbMarshaler interface {
	Marshal(out io.Writer, pb proto.Message) error
}

type LogConf

type LogConf struct {
	ServiceName string `toml:"service_name" mapstructure:"service_name" json:"service_name"`
	Mode        string `toml:"mode" json:"mode"`
	Path        string `toml:"path" json:"path"`
	Level       string `toml:"level" json:"level"`
	Compress    bool   `toml:"compress" json:"compress"`
	KeepDays    int    `toml:"keep_days" mapstructure:"keep_days" json:"keep_days"`
}

type Logger

type Logger interface {
	Debugf(format string, data ...interface{})
	Infof(format string, data ...interface{})
	Warnf(format string, data ...interface{})
	Errorf(format string, data ...interface{})
	Panicf(format string, data ...interface{})
}

type RecoveryHandlerContextFunc

type RecoveryHandlerContextFunc func(ctx context.Context, p interface{}) (err error)

type ServerLoggingDecider

type ServerLoggingDecider func(ctx context.Context, methodName string, servingObject interface{}) bool

type Tags

type Tags interface {
	// Set sets the given key in the metadata tags.
	Set(key string, value interface{}) Tags
	// Has checks if the given key exists.
	Has(key string) bool
	// Values returns a map of key to values.
	// Do not modify the underlying map, please use Set instead.
	Values() map[string]interface{}
}

func Extract

func Extract(ctx context.Context) Tags

func NewTags

func NewTags() Tags

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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