logger

package
v0.0.0-...-35c4c52 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Degub    = -1
	Info     = 0
	Warn     = 1
	Error    = 2
	Critical = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FormatLogFunc

type FormatLogFunc interface {
	Criticalf(ctx context.Context, msg string, a ...interface{})
	Errorf(ctx context.Context, mst string, a ...interface{})
	Warnf(ctx context.Context, mst string, a ...interface{})
	Infof(ctx context.Context, mst string, a ...interface{})
	Debugf(ctx context.Context, mst string, a ...interface{})
}

type Level

type Level int

Logging level.

func (Level) String

func (lv Level) String() string

type LogFunc

type LogFunc interface {
	Critical(ctx context.Context, msg string)
	Error(ctx context.Context, mst string)
	Warn(ctx context.Context, mst string)
	Info(ctx context.Context, mst string)
	Debug(ctx context.Context, mst string)
}

type Logger

type Logger interface {
	LogFunc
	FormatLogFunc
	Print(ctx context.Context, lv Level, msg string)
}

func NewFileLogger

func NewFileLogger(
	path string,
	host string,
	service string,
) (Logger, func() error, error)

func NewMemoryLogger

func NewMemoryLogger(level Level) Logger

Jump to

Keyboard shortcuts

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