logger

package
v0.0.0-...-337f3ca Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

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 Panic

func Panic(info ...interface{})

Fatal print the panic message.

func Panicf

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

Panicf print the panic message.

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
	LogToSysLog  bool
	SysLogPrefix string

	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
}

Directories

Path Synopsis
internal/bufferpool
Package bufferpool houses zap's shared internal buffer pool.
Package bufferpool houses zap's shared internal buffer pool.

Jump to

Keyboard shortcuts

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