logger

package
v0.0.0-...-4dc1fac Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DPanic

func DPanic(msg string, args ...zap.Field)

func Debug

func Debug(msg string, args ...zap.Field)

func Error

func Error(msg string, args ...zap.Field)

func Fatal

func Fatal(msg string, args ...zap.Field)

func Info

func Info(msg string, args ...zap.Field)

func Init

func Init(cfgLog string, module string)

func Panic

func Panic(msg string, args ...zap.Field)

func SetConsoleLevel

func SetConsoleLevel(level zapcore.Level)

公共函数

func SetFileLevel

func SetFileLevel(level zapcore.Level)

func StructField

func StructField(i interface{}) []zap.Field

i 为结构体,不能是结构体的指针

func Warn

func Warn(msg string, args ...zap.Field)

Types

type LogConfig

type LogConfig struct {
	ConsoleEnable bool       `yaml:"consoleEnable""`
	Filename      string     `yaml:"filename"`
	MaxSize       int        `yaml:"maxSize"`
	MaxBackups    int        `yaml:"maxBackups"`
	MaxAge        int        `yaml:"maxAge"`
	CallerSkip    int        `yaml:"callerSkip"`
	Zap           zap.Config `yaml:"zap"`
}

type LogConfiguration

type LogConfiguration struct {
	LogCfgs map[string]*LogConfig `yaml:logConfigs`
}

type Logger

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

func GetLogger

func GetLogger() *Logger

func NewLogger

func NewLogger(module string, logCfg *LogConfig, bDefault bool) *Logger

func (*Logger) DPanic

func (l *Logger) DPanic(msg string, args ...zap.Field)

func (*Logger) Debug

func (l *Logger) Debug(msg string, args ...zap.Field)

func (*Logger) Error

func (l *Logger) Error(msg string, args ...zap.Field)

func (*Logger) Fatal

func (l *Logger) Fatal(msg string, args ...zap.Field)

func (*Logger) Info

func (l *Logger) Info(msg string, args ...zap.Field)

func (*Logger) Panic

func (l *Logger) Panic(msg string, args ...zap.Field)

func (*Logger) SetConsoleLevel

func (l *Logger) SetConsoleLevel(level zapcore.Level)

func (*Logger) SetFileLevel

func (l *Logger) SetFileLevel(level zapcore.Level)

func (*Logger) Warn

func (l *Logger) Warn(msg string, args ...zap.Field)

func (*Logger) Write

func (l *Logger) Write(p []byte) (n int, err error)

Logger 函数 for log

Jump to

Keyboard shortcuts

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