evt2log

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: Apache-2.0 Imports: 9 Imported by: 10

Documentation

Index

Constants

View Source
const (
	TypeValue = "event.2"

	EventNameKey = "eventName"
	ValuesKey    = "values"
	TagsKey      = "tags"
)

Variables

This section is empty.

Functions

func ApplyParam

func ApplyParam(p Param, entry wlog.LogEntry)

func SetDefaultLoggerCreator

func SetDefaultLoggerCreator(creator func() Logger)

func ToParams added in v1.13.0

func ToParams(evtName string, inParams []Param) []wlog.Param

func WithLogger

func WithLogger(ctx context.Context, logger Logger) context.Context

WithLogger returns a copy of the provided context with the provided Logger included as a value. This operation will replace any logger that was previously set on the context (along with all parameters that may have been set on the logger).

Types

type Logger

type Logger interface {
	Event(name string, params ...Param)
}

func FromContext

func FromContext(ctx context.Context) Logger

FromContext returns the Logger stored in the provided context. If no logger is set on the context, returns the logger created by calling DefaultLogger. If the context contains a TraceID set using wtracing, the returned logger has that TraceID set on it as a parameter.

func New

func New(w io.Writer) Logger

func NewFromCreator

func NewFromCreator(w io.Writer, creator wlog.LoggerCreator) Logger

func WithParams

func WithParams(logger Logger, params ...Param) Logger

type Param

type Param interface {
	// contains filtered or unexported methods
}

func SID

func SID(sid string) Param

func Tag

func Tag(key, value string) Param

func Tags

func Tags(values map[string]string) Param

func TokenID

func TokenID(tokenID string) Param

func TraceID

func TraceID(traceID string) Param

func UID

func UID(uid string) Param

func UnsafeParam

func UnsafeParam(key string, value interface{}) Param

func UnsafeParams

func UnsafeParams(unsafe map[string]interface{}) Param

func Value

func Value(key string, value interface{}) Param

func Values

func Values(values map[string]interface{}) Param

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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