logger

package
v1.2.24 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: Apache-2.0 Imports: 9 Imported by: 160

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 added in v1.2.9

func Debug(info ...interface{})

Debug print the debug message.

func Debugf added in v1.2.9

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

Debugf print the debug message.

func Error

func Error(err ...interface{})

Error print the error message.

func Errorf added in v1.2.9

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

Errorf print the error message.

func Fatal added in v1.2.9

func Fatal(info ...interface{})

Fatal print the fatal message.

func Fatalf added in v1.2.9

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

Fatalf print the fatal message.

func Info

func Info(info ...interface{})

Info print the info message.

func Infof added in v1.2.9

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

Info print the info message.

func InitWithConfig added in v1.2.9

func InitWithConfig(cfg Config)

func LogSQL added in v1.0.8

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

LogSQL print the sql info message.

func OpenSQLLog added in v1.0.8

func OpenSQLLog()

OpenSQLLog set the sqlLogOpen true.

func Panic added in v1.2.16

func Panic(info ...interface{})

Fatal print the panic message.

func Panicf added in v1.2.16

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

Panicf print the panic message.

func SetRotate added in v1.2.9

func SetRotate(cfg RotateCfg)

func Warn

func Warn(info ...interface{})

Warn print the warning message.

func Warnf added in v1.2.9

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

Warnf print the warning message.

Types

type Config added in v1.2.9

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 added in v1.2.9

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 added in v1.2.9

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

func (*Logger) Init added in v1.2.9

func (l *Logger) Init()

func (*Logger) SetEncoder added in v1.2.9

func (l *Logger) SetEncoder(cfg EncoderCfg)

func (*Logger) SetRotate added in v1.2.9

func (l *Logger) SetRotate(cfg RotateCfg)

type RotateCfg added in v1.2.9

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