log

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CtxIDKey = ctxIDKeyType("ID")

Functions

func Debug

func Debug(ctx context.Context, msg string, fields F)

func Error

func Error(ctx context.Context, msg interface{}, fields F) error

func Fatal

func Fatal(msg string, fields F)

func GetID

func GetID(ctx context.Context) uuid.UUID

GetID returns the UUID from the context, or the UUID if it doesn't exist

func Info

func Info(ctx context.Context, msg string, fields F)

func Panic

func Panic(ctx context.Context, msg interface{}, fields F)

func SetLevel

func SetLevel(lvl LogLevel)

func Warn

func Warn(ctx context.Context, msg string, fields F)

func WithID

func WithID(ctx context.Context) context.Context

WithID adds a correlation ID to the ctx. If one already exists, it's a no-op

Types

type F

type F map[string]string

type LogLevel

type LogLevel int
const (
	DEBUG LogLevel = iota + 1
	INFO
	WARN
	ERROR
)

Jump to

Keyboard shortcuts

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