logs

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInitFailed  = errors.New("failed to initialize logs")
	ErrBadLogLevel = errors.New("invalid log level")
)

Functions

func Init

func Init(config Logs) error

func ParseLevel added in v0.2.0

func ParseLevel(level string) (slog.Level, error)

Determines the log level from a provided string The string is trimmed of whitespaced and converted to uppercase

Types

type Logs

type Logs struct {
	LogLevel    string `env:"LOG_LEVEL" envDefault:"INFO"`
	Pretty      bool   `env:"PRETTY_LOGS" envDefault:"false"`
	ServiceName string `env:"SERVICE_NAME" envDefault:"_"`
	Environment string `env:"ENVIRONMENT" envDefault:"dev"`
}

Jump to

Keyboard shortcuts

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