clog

package
v0.5.38 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 7 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 Fatalf

func Fatalf(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 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