logger

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: Apache-2.0 Imports: 9 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Access

func Access(ctx *context.Context)

Access print the access message.

func Debug

func Debug(info ...interface{})

Debug print the debug message.

func Debugf

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

Debugf print the debug message.

func Error

func Error(err ...interface{})

Error print the error message.

func Errorf

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

Errorf print the error message.

func Fatal

func Fatal(info ...interface{})

Fatal print the fatal message.

func Fatalf

func Fatalf(template string, args ...interface{})

Fatalf print the fatal message.

func Info

func Info(info ...interface{})

Info print the info message.

func Infof

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

Info print the info message.

func InitWithConfig

func InitWithConfig(cfg Config)

func LogSQL

func LogSQL(statement string, args []interface{})

LogSQL print the sql info message.

func OpenSQLLog

func OpenSQLLog()

OpenSQLLog set the sqlLogOpen true.

func SetAccessLogger

func SetAccessLogger(path string, isAccessLogOff bool)

SetAccessLogger set the access logger.

func SetErrorLogger

func SetErrorLogger(path string, isErrorLogOff bool)

SetErrorLogger set the error logger.

func SetInfoLogger

func SetInfoLogger(path string, isInfoLogOff bool)

SetInfoLogger set the info logger.

func SetRotate

func SetRotate(cfg RotateCfg)

func Warn

func Warn(info ...interface{})

Warn print the warning message.

func Warnf

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

Warnf print the warning message.

Types

type Config

type Config struct {
	InfoLogOff   bool
	ErrorLogOff  bool
	AccessLogOff bool

	SqlLogOpen bool

	InfoLogPath   string
	ErrorLogPath  string
	AccessLogPath string

	AccessAssetsLogOff bool

	Rotate RotateCfg
	Encode EncoderCfg

	Level int8

	Debug bool
}

type EncoderCfg

type EncoderCfg struct {
	TimeKey       string
	LevelKey      string
	NameKey       string
	CallerKey     string
	MessageKey    string
	StacktraceKey string
	Level         string
	Time          string
	Duration      string
	Caller        string
	Encoding      string
}

type Logger

type Logger struct {
	Level zapcore.Level
	// contains filtered or unexported fields
}

func (*Logger) Init

func (l *Logger) Init()

func (*Logger) SetEncoder

func (l *Logger) SetEncoder(cfg EncoderCfg)

func (*Logger) SetRotate

func (l *Logger) SetRotate(cfg RotateCfg)

type RotateCfg

type RotateCfg struct {
	MaxSize    int
	MaxBackups int
	MaxAge     int
	Compress   bool
}

Jump to

Keyboard shortcuts

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