logs

package
v0.0.0-...-38a39c4 Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WriterConsole console输出
	WriterConsole = "console"
	// WriterFile 文件输出
	WriterFile = "file"
)

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

Debug logger

func Debugf

func Debugf(format string, args ...interface{})

Debugf logger

func Error

func Error(args ...interface{})

Error logger

func Errorf

func Errorf(format string, args ...interface{})

Errorf logger

func Info

func Info(args ...interface{})

Info logger

func Infof

func Infof(format string, args ...interface{})

Infof logger

func NewEchoLogger

func NewEchoLogger(cfg *Config) *log.Logger

NewEchoLogger new echo logger

func Warn

func Warn(args ...interface{})

Warn logger

func Warnf

func Warnf(format string, args ...interface{})

Warnf logger

Types

type Config

type Config struct {
	Encoding   string
	Level      string
	Writers    string
	LoggerFile string
}

Config log config

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(args ...interface{})
	Errorf(format string, args ...interface{})
}

Logger is a contract for the logger

var Log Logger

func GetLogger

func GetLogger() Logger

GetLogger return a log

func NewLogger

func NewLogger(c *Config) Logger

NewLogger Init initializes logs

Jump to

Keyboard shortcuts

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