logger

package
Version: v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugLevel int = iota
	InfoLevel
	WarnLevel
	ErrorLevel
	FatalLevel
	PanicLevel
)

Variables

This section is empty.

Functions

func Close

func Close()

func Debug

func Debug(a ...interface{})

func Debugf added in v0.0.3

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

func Error

func Error(a ...interface{})

func Errorf added in v0.0.3

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

func Export

func Export(logger *Logger)

It's dangerous to call the method on logging

func Fatal

func Fatal(a ...interface{})

func Fatalf added in v0.0.3

func Fatalf(format string, a ...interface{})

func Info

func Info(a ...interface{})

func Infof added in v0.0.3

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

func IsExist added in v0.0.3

func IsExist(path string) bool

func NewZapLogger added in v0.0.3

func NewZapLogger(zc ZapConfig) error

SetLogger 设置logger

func Panic

func Panic(a ...interface{})

func Panicf added in v0.0.3

func Panicf(format string, a ...interface{})

func Warn

func Warn(a ...interface{})

func Warnf added in v0.0.3

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

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func New

func New(strLevel string, mode PrintMode, baseFolder string, flag int) (*Logger, error)

func (*Logger) Close

func (logger *Logger) Close()

It's dangerous to call the method on logging

func (*Logger) Debug

func (logger *Logger) Debug(a ...interface{})

func (*Logger) Debugf added in v0.0.3

func (logger *Logger) Debugf(format string, a ...interface{})

func (*Logger) Error

func (logger *Logger) Error(a ...interface{})

func (*Logger) Errorf added in v0.0.3

func (logger *Logger) Errorf(format string, a ...interface{})

func (*Logger) Fatal

func (logger *Logger) Fatal(a ...interface{})

func (*Logger) Fatalf added in v0.0.3

func (logger *Logger) Fatalf(format string, a ...interface{})

func (*Logger) Info

func (logger *Logger) Info(a ...interface{})

func (*Logger) Infof added in v0.0.3

func (logger *Logger) Infof(format string, a ...interface{})

func (*Logger) Panic

func (logger *Logger) Panic(a ...interface{})

func (*Logger) Panicf added in v0.0.3

func (logger *Logger) Panicf(format string, a ...interface{})

func (*Logger) Warn

func (logger *Logger) Warn(a ...interface{})

func (*Logger) Warnf added in v0.0.3

func (logger *Logger) Warnf(format string, a ...interface{})

type PrintMode

type PrintMode int
const (
	ConsoleMode PrintMode = iota //控制台打印
	FileMode                     //文件输出
)

type ZapConfig added in v0.0.3

type ZapConfig struct {
	Level                  string
	Outputs                string
	Encode                 string
	ColorLevel             bool
	EnableTrace            bool
	EnableCaller           bool
	EnableNotFound         bool
	EnableMethodNotAllowed bool
	Debug                  bool
}

Source Files

Jump to

Keyboard shortcuts

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