log

package
v0.0.0-...-76d8645 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogFormatText = "text"
	LogFormatJSON = "json"
)

Variables

This section is empty.

Functions

func SlogLevel

func SlogLevel(level string) slog.Level

SlogLevel converts a string level to the slog level.

Types

type Config

type Config struct {
	// Level is the minimum log level that should appear on the output.
	Level string

	// Format specifies the output log format.
	// Accepted values are: json, text
	Format string
}

Config holds details necessary for logging.

func (Config) NewSlog

func (c Config) NewSlog() *slog.Logger

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳