log

package
v0.8.10 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllFormatsJoined

func AllFormatsJoined() string

AllFormatsJoined returns all formats joined by "|"

func AllFormatsStr

func AllFormatsStr() []string

AllFormatsStr returns all formats as strings

func AllLevelsJoined

func AllLevelsJoined() string

AllLevelsJoined returns all levels joined by "|"

func AllLevelsStr

func AllLevelsStr() []string

AllLevelsStr returns all levels as strings

func ParseLevel

func ParseLevel(level Level) slog.Level

ParseLevel converts a log level to a slog level

Types

type Format

type Format string
const (
	FormatPlain Format = "plain"
	FormatJSON  Format = "json"

	DefaultFormat = FormatPlain
)

func AllFormats

func AllFormats() []Format

AllFormats returns all formats

func (Format) String

func (f Format) String() string

String returns the string representation of the format

type Level

type Level string
const (
	LevelDebug Level = "debug"
	LevelInfo  Level = "info"
	LevelWarn  Level = "warn"
	LevelError Level = "error"

	DefaultLevel = LevelInfo
)

func AllLevels

func AllLevels() []Level

AllLevels returns all levels

func (Level) String

func (l Level) String() string

String returns the string representation of the level

Jump to

Keyboard shortcuts

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