logs

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Database

func Database(name string) slog.Attr

func Error

func Error(err error) slog.Attr

func Get

func Get(cfg Config) *slog.Logger

func Trigger

func Trigger(id string) slog.Attr

func User

func User(id string) slog.Attr

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