wblogger

package module
v0.0.0-...-dceb832 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TraceID  logField = "traceID"
	OrderUID logField = "orderUID"
	Handler  logField = "handler"
	ClientID logField = "clientID"
	UserID   logField = "userID"
	ItemSRID logField = "itemSRID"
	ItemRID  logField = "itemRID"
)
View Source
const IOCTL_SYNC_ERROR = "sync /dev/stdout: inappropriate ioctl for device"

Variables

This section is empty.

Functions

func CtxField

func CtxField(field string)

func Debug

func Debug(ctx context.Context, msg string)

Debug logs msg with debug level if ORDO_LOG_LEVEL set to DEBUG.

func Debugf

func Debugf(ctx context.Context, msg string, fields ...string)

func EchoMWLogger

func EchoMWLogger(ignoreUrls []string) echo.MiddlewareFunc

func Error

func Error(ctx context.Context, msg string, err error)

Error logs msg with error level. Adds first err as and error field

func Errorf

func Errorf(ctx context.Context, msg string, err error, fields ...string)

func Flush

func Flush()

Flush flushes all logs to stdout.

func Info

func Info(ctx context.Context, msg string)

Info logs msg with info level.

func Infof

func Infof(ctx context.Context, msg string, fields ...string)

func SendError

func SendError(ctx context.Context, err error, fields ...string)

SendError writing error with stack trace to sentry TODO при логировании ошибок, имеют тип: errors.errorString (нужны отдельные типы, если хотим красиво) и слегка раздутый stacktrace (если передавать сюда ошибку из пакета github.com/pkg/errors, проблема исчезает)

func Warn

func Warn(ctx context.Context, msg string)

Warn logs msg with warn level.

func Warnf

func Warnf(ctx context.Context, msg string, fields ...string)

func WithField

func WithField(ctx context.Context, key, value string) context.Context

func WithSentry

func WithSentry(dsn, environment, version string) error

WithSentry attaches sentry to logger. All Error calls will be written to sentry

Types

This section is empty.

Jump to

Keyboard shortcuts

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