logging

package
v0.2.42 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	LogFormatJSON    = "json"
	LogFormatConsole = "console"
)

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context, opts ...Option) (context.Context, error)

Init creates a new zap logger and attaches it to the provided context.

Types

type Option added in v0.1.0

type Option func(*zap.Config)

func WithInitialFields added in v0.2.41

func WithInitialFields(fields map[string]interface{}) Option

WithInitialFields allows the logger to be configured with static fields at creation time. This is useful for setting fields that are constant across all log messages.

func WithLogFormat added in v0.1.0

func WithLogFormat(format string) Option

func WithLogLevel added in v0.1.0

func WithLogLevel(level string) Option

func WithOutputPaths added in v0.1.0

func WithOutputPaths(paths []string) Option

Jump to

Keyboard shortcuts

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