logger

package
v0.0.0-...-e759c69 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *slog.Logger

func NewWithOptions

func NewWithOptions(opts ...Option) *slog.Logger

Types

type Encoding

type Encoding string
const (
	EncodingConsole Encoding = "console"
	EncodingJSON    Encoding = "json"
)

type Level

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

type Logger

type Logger interface {
	Debug(msg string, args ...any)
	Info(msg string, args ...any)
	Warn(msg string, args ...any)
	Error(msg string, args ...any)
}

type Option

type Option func(o *Options)

func WithAppName

func WithAppName(name string) Option

func WithEncoding

func WithEncoding(encoding Encoding) Option

func WithLevel

func WithLevel(level Level) Option

type Options

type Options struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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