logger

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EncoderJSON    = "json"
	EncoderConsole = "console"
)

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func Debugf

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

func Error

func Error(args ...interface{})

func Errorf

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

func Info

func Info(args ...interface{})

func Infof

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

func Warn

func Warn(args ...interface{})

func Warnf

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

Types

type Config

type Config struct {
	Output         []string
	FilePath       string
	Level          string
	MaxRotatedSize int
	MaxRetainDay   int
	MaxRetainFiles int
	LocalTime      bool
	Encoder        string
	Caller         bool
	Fn             bool
}

type Level

type Level int8
const (
	NoneLevel Level = iota
	DebugLevel
	InfoLevel
	WarnLevel
	ErrorLevel
)

func ParseLevel

func ParseLevel(text string) Level

type Logger

type Logger interface {
	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
}

func NewLogger

func NewLogger(conf Config) Logger

func NewZapLogger

func NewZapLogger(conf ZapLoggerConfig) Logger

type ZapLoggerConfig

type ZapLoggerConfig struct {
	Level   string
	Writer  []io.Writer
	Encoder string
	Caller  bool
	Fn      bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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