logging

package
v0.180.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	RequestIDHeader = "X-Request-Id"

	//	environment variables
	WgCloudEnvironmentID = "WG_CLOUD_ENVIRONMENT_ID"
	WgCloudProjectID     = "WG_CLOUD_PROJECT_ID"
	WgCloudDeploymentID  = "WG_CLOUD_DEPLOYMENT_ID"
)

Variables

This section is empty.

Functions

func FindLogLevel added in v0.112.0

func FindLogLevel(logLevel string) (zapcore.Level, error)

func New

func New(prettyLogging bool, debug bool, level zap.AtomicLevel) *zap.Logger

func RequestIDFromContext added in v0.117.0

func RequestIDFromContext(ctx context.Context) string

func WithRequestID added in v0.117.0

func WithRequestID(reqID string) zap.Field

func WithRequestIDFromContext added in v0.117.0

func WithRequestIDFromContext(ctx context.Context) zap.Field

Types

type Prettifier added in v0.166.0

type Prettifier struct {
	// contains filtered or unexported fields
}

func NewPrettifier added in v0.166.0

func NewPrettifier(config PrettifierConfig) *Prettifier

func (*Prettifier) PrettifyJSON added in v0.166.0

func (p *Prettifier) PrettifyJSON(r io.Reader) (*buffer.Buffer, error)

type PrettifierConfig added in v0.166.0

type PrettifierConfig struct {
	DisableColor  bool
	LevelKey      string
	MessageKey    string
	CallerKey     string
	TimeKey       string
	StacktraceKey string
	ComponentKey  string
	IgnoredKeys   []string
}

type RequestIDKey added in v0.117.0

type RequestIDKey struct{}

Jump to

Keyboard shortcuts

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