logging

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelInfo  = "info"
	LevelError = "error"
	LevelWarn  = "warn"
	LevelDebug = "debug"
)

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, fmt string, args ...interface{})

func Error

func Error(ctx context.Context, fmt string, args ...interface{})

func Info

func Info(ctx context.Context, fmt string, args ...interface{})

func LogrusModule

func LogrusModule() fx.Option

func NewInMemoryLogger

func NewInMemoryLogger() *inMemoryLogger

func NewLogrusLogger

func NewLogrusLogger() *logrusLogger

func SetDefaultLogger

func SetDefaultLogger(l Logger)

func Warn

func Warn(ctx context.Context, fmt string, args ...interface{})

Types

type Logger

type Logger interface {
	Info(ctx context.Context, fmt string, args ...interface{})
	Error(ctx context.Context, fmt string, args ...interface{})
	Warn(ctx context.Context, fmt string, args ...interface{})
	Debug(ctx context.Context, fmt string, args ...interface{})
	WithFields(map[string]interface{}) Logger
}

func DefaultLogger

func DefaultLogger() Logger

func WithFields

func WithFields(fields map[string]interface{}) Logger

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳