log

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(cfg Config) *slog.Logger

Types

type Config

type Config struct {
	Level     slog.Level `yaml:"level,omitempty" default:"INFO" doc:"Уровень логирования." enum:"DEBUG,INFO,WARN,ERROR"`
	Encoding  Encoding   `yaml:"encoding,omitempty" default:"text" doc:"Формат логирования."`
	AddSource bool       `yaml:"addSource,omitempty" doc:"Добавлять ли номера строк в логи."`
}

type Encoding

type Encoding string
const (
	Text Encoding = "text"
	JSON Encoding = "json"
)

func (Encoding) SchemaEnum

func (Encoding) SchemaEnum() any

Jump to

Keyboard shortcuts

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