Documentation ¶
Index ¶
- Constants
- func ApplyParam(p Param, entry wlog.LogEntry)
- func SetDefaultLoggerCreator(creator func() Logger)
- func ToParams(evtName string, inParams []Param) []wlog.Param
- func WithLogger(ctx context.Context, logger Logger) context.Context
- type Logger
- type Param
- func OrgID(orgID string) Param
- func SID(sid string) Param
- func Tag(key, value string) Param
- func Tags(values map[string]string) Param
- func TokenID(tokenID string) Param
- func TraceID(traceID string) Param
- func UID(uid string) Param
- func UnsafeParam(key string, value interface{}) Param
- func UnsafeParams(unsafe map[string]interface{}) Param
- func Value(key string, value interface{}) Param
- func Values(values map[string]interface{}) Param
Constants ¶
View Source
const ( TypeValue = "event.2" EventNameKey = "eventName" ValuesKey = "values" TagsKey = "tags" )
Variables ¶
This section is empty.
Functions ¶
func ApplyParam ¶
func SetDefaultLoggerCreator ¶
func SetDefaultLoggerCreator(creator func() Logger)
func WithLogger ¶
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 ¶
func FromContext ¶
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 NewFromCreator ¶
func NewFromCreator(w io.Writer, creator wlog.LoggerCreator) Logger
func WithParams ¶
type Param ¶
type Param interface {
// contains filtered or unexported methods
}
func UnsafeParam ¶
func UnsafeParams ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.