logging

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) *zap.SugaredLogger

func InitLogger added in v0.4.0

func InitLogger(level LogLevel)

Initializes the logger with the input level, defaulting to Info if the input is invalid

func WithLogger

func WithLogger(ctx context.Context) context.Context

Types

type LogLevel added in v0.4.0

type LogLevel string
const (
	Debug  LogLevel = "debug"
	Info   LogLevel = "info"
	Warn   LogLevel = "warn"
	Error  LogLevel = "error"
	DPanic LogLevel = "dpanic"
	Panic  LogLevel = "panic"
	Fatal  LogLevel = "fatal"
)

func ParseLevel added in v0.4.0

func ParseLevel(level string) (LogLevel, error)

convert a string to the LogLevel type

Jump to

Keyboard shortcuts

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