clog

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package clog provides Context with logging information.

Index

Constants

View Source
const (
	ClientIP = "clientIP"
)

Variables

This section is empty.

Functions

func AddManifestID

func AddManifestID(ctx context.Context, val string) context.Context

func AddNonce

func AddNonce(ctx context.Context, val uint64) context.Context

func AddOrchSessionID

func AddOrchSessionID(ctx context.Context, val string) context.Context

func AddSeqNo

func AddSeqNo(ctx context.Context, val uint64) context.Context

func AddSessionID

func AddSessionID(ctx context.Context, val string) context.Context

func AddVal

func AddVal(ctx context.Context, key, val string) context.Context

func Clone

func Clone(parentCtx, logCtx context.Context) context.Context

Clone creates new context with parentCtx as parent and logging details from logCtx

func Errorf

func Errorf(ctx context.Context, format string, args ...interface{})

func GetManifestID added in v0.5.28

func GetManifestID(ctx context.Context) string

func GetVal added in v0.5.28

func GetVal(ctx context.Context, key string) string

func Infof

func Infof(ctx context.Context, format string, args ...interface{})

func InfofErr

func InfofErr(ctx context.Context, format string, args ...interface{})

InfofErr if last argument is not nil it will be printed as " err=%q"

func PublicCloneCtx added in v0.6.0

func PublicCloneCtx(originalCtx context.Context, publicCtx context.Context, publicLogKeys []string) context.Context

PublicCloneCtx creates a new context but only copies key/val pairs from the original context that are allowed to be published publicly (i.e. list in []publicLogKeys

func PublicInfof added in v0.6.0

func PublicInfof(ctx context.Context, format string, args ...interface{})

func Warningf

func Warningf(ctx context.Context, format string, args ...interface{})

func WithTimeout added in v0.5.35

func WithTimeout(parentCtx, logCtx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)

Types

type Verbose

type Verbose bool

Verbose is a boolean type that implements Infof (like Printf) etc.

func V

func V(level glog.Level) Verbose

func (Verbose) Infof

func (v Verbose) Infof(ctx context.Context, format string, args ...interface{})

Infof is equivalent to the global Infof function, guarded by the value of v. See the documentation of V for usage.

func (Verbose) InfofErr

func (v Verbose) InfofErr(ctx context.Context, format string, args ...interface{})

Jump to

Keyboard shortcuts

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