logger

package
v0.0.0-...-5a20165 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestId    ContextKey = 0
	TxId         ContextKey = 1
	OPLabel                 = "op"
	RequestLabel            = "request_id"

	TxLabel = "tx_number"
)

Variables

This section is empty.

Functions

func AddPlaceAndRequestId

func AddPlaceAndRequestId(log *slog.Logger, place string, r *http.Request) *slog.Logger

AddPlaceAndRequestId добавляет в logger место запуска и идентификатор запроса.

func LogWithCtxData

func LogWithCtxData(ctx context.Context, log *slog.Logger) *slog.Logger

LogWithCtxData извлекает, при наличии, из контекста идентификатор запроса и номер транзакции и добавляет в logger.

func MustCreate

func MustCreate(environment, instance string) *slog.Logger

MustCreate возвращает экземпляр *slog.Logger или останавливает программу, если окружение environment указано неверно.

Types

type ContextKey

type ContextKey int

Jump to

Keyboard shortcuts

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