utils

package
v8.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: AGPL-3.0, AGPL-3.0-or-later Imports: 12 Imported by: 0

Documentation

Overview

Structured logging handler for logrus so we can rewrite code to use slog package incrementally. Once all logging is happening via slog, we just need to hook up Sentry directly to that, and then we can get rid of this file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeJSONRequest

func MakeJSONRequest(method string, url string, body []byte, dest any) (*http.Response, error)

MakeJSONRequest is a utility function to make a JSON request, optionally decoding the response into the passed in struct

Types

type LogrusHandler added in v8.3.1

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

func NewLogrusHandler added in v8.3.1

func NewLogrusHandler(logger *logrus.Logger) *LogrusHandler

func (*LogrusHandler) Enabled added in v8.3.1

func (l *LogrusHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*LogrusHandler) Handle added in v8.3.1

func (l *LogrusHandler) Handle(ctx context.Context, r slog.Record) error

func (*LogrusHandler) WithAttrs added in v8.3.1

func (l *LogrusHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*LogrusHandler) WithGroup added in v8.3.1

func (l *LogrusHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

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