logger

package
v0.0.0-...-9d3578c Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 4 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 NewBasicLogger

func NewBasicLogger(
	writer io.Writer,
	host string,
	service string,
) Logger

Jump to

Keyboard shortcuts

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