logger

package
v3.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextSetLogger

func ContextSetLogger(ctx context.Context, value Interface) context.Context

Types

type CaptureInterface

type CaptureInterface interface {
	Interface
	GetBuffer() *bytes.Buffer
	String() string
	Reset()
}

func NewCaptureLogger

func NewCaptureLogger() CaptureInterface

type Fun

type Fun func(string, ...any)

type Interface

type Interface interface {
	MessageInterface
	ManageInterface
}

func ContextGetLogger

func ContextGetLogger(ctx context.Context) Interface

func NewLogger

func NewLogger() Interface

type Level

type Level int
const (
	Message Level = iota
	Trace   Level = iota
	Debug   Level = iota
	Info    Level = iota
	Warn    Level = iota
	Error   Level = iota
	Fatal   Level = iota
)

func LessVerbose

func LessVerbose(level Level) *Level

func MoreVerbose

func MoreVerbose(level Level) *Level

func (Level) String

func (l Level) String() string

type Logger

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

func (*Logger) Debug

func (o *Logger) Debug(message string, args ...any)

func (*Logger) Error

func (o *Logger) Error(message string, args ...any)

func (*Logger) Fatal

func (o *Logger) Fatal(message string, args ...any)

func (*Logger) GetLevel

func (o *Logger) GetLevel() Level

func (*Logger) GetLogger

func (o *Logger) GetLogger() Interface

func (*Logger) Info

func (o *Logger) Info(message string, args ...any)

func (*Logger) Log

func (o *Logger) Log(skip int, level Level, message string, args ...any)

func (*Logger) Message

func (o *Logger) Message(message string, args ...any)

func (*Logger) SetLevel

func (o *Logger) SetLevel(level Level)

func (*Logger) SetLogger

func (o *Logger) SetLogger(logger Interface)

func (*Logger) Trace

func (o *Logger) Trace(message string, args ...any)

func (*Logger) Warn

func (o *Logger) Warn(message string, args ...any)

type ManageInterface

type ManageInterface interface {
	SetLevel(level Level)
	GetLevel() Level
}

type MessageInterface

type MessageInterface interface {
	Message(string, ...any)
	Trace(string, ...any)
	Debug(string, ...any)
	Info(string, ...any)
	Warn(string, ...any)
	Error(string, ...any)
	Fatal(string, ...any)
	Log(skip int, level Level, message string, args ...any)
}

Jump to

Keyboard shortcuts

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