log

package
v0.0.0-...-df377f8 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GinMiddleware

func GinMiddleware() gin.HandlerFunc

func SetDefault

func SetDefault(l Logger)

func SetLogLevel

func SetLogLevel(level LogLevel)

func SetLogLevelFromString

func SetLogLevelFromString(level string) error

func Setup

func Setup(level string, noColor bool) error

Types

type Config

type Config struct {
	UseColors bool
	LogTime   bool
}

type LogLevel

type LogLevel int
const (
	None LogLevel = iota - 1
	DebugLevel
	InfoLevel
	WarnLevel
	ErrorLevel
)

type Logger

type Logger interface {
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Warn(args ...interface{})
	Warnf(format string, args ...interface{})
	Error(err error)
	Errorf(format string, args ...interface{})
	// contains filtered or unexported methods
}
var Default Logger = loggerImpl{
	Config: Config{
		UseColors: true,
		LogTime:   true,
	},
}

func New

func New(cfg *Config) Logger

Jump to

Keyboard shortcuts

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