log

package
v0.0.0-...-07ef3d6 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFlags = log.LUTC | log.Ldate | log.Ltime | log.Lmsgprefix

	LevelDebug = "debug"
	LevelInfo  = "info"
	LevelWarn  = "warn"
	LevelError = "error"
)

Variables

View Source
var (
	HoneybadgerAPIKey string
	HoneybadgerSync   bool
)

Functions

func ContextUUID

func ContextUUID(ctx context.Context) string

func ContextWithUUID

func ContextWithUUID(ctx context.Context, uuid string) context.Context

func DebugT

func DebugT(msg string, tags ...Tag)

func Debugf

func Debugf(format string, args ...any)

func ErrorT

func ErrorT(msg string, tags ...Tag)

func Errorf

func Errorf(format string, args ...any)

func PrintT

func PrintT(msg string, tags ...Tag)

func Printf

func Printf(format string, args ...any)

func Start

func Start(ctx context.Context)

func Sync

func Sync()

func WarnT

func WarnT(msg string, tags ...Tag)

func Warnf

func Warnf(format string, args ...any)

Types

type Logger

type Logger interface {
	Debugf(string, ...any)
	Printf(string, ...any)
	Warnf(string, ...any)
	Errorf(string, ...any)

	DebugT(string, ...Tag)
	PrintT(string, ...Tag)
	WarnT(string, ...Tag)
	ErrorT(string, ...Tag)

	Monitor()
}

func ContextLogger

func ContextLogger(ctx context.Context) Logger

type Reporter

type Reporter interface {
	Start(ctx context.Context) error
	Errorf(string, ...any) error
	Monitor()
}

func NewNoneReporter

func NewNoneReporter() Reporter

type Tag

type Tag struct {
	Key   string
	Value any
}

func NewTag

func NewTag(k string, v any) Tag

Jump to

Keyboard shortcuts

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