logger

package
v0.0.0-...-b952f1b Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

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

func DebugF

func DebugF(args ...interface{})

func Error

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

func ErrorF

func ErrorF(args ...interface{})

func Fatal

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

func FatalF

func FatalF(args ...interface{})

func Info

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

func InfoF

func InfoF(args ...interface{})

func NewDefaultLogger

func NewDefaultLogger()

func NewDefaultLoggerWithConfig

func NewDefaultLoggerWithConfig(logConfig LoggerConfig)

func Panic

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

func PanicF

func PanicF(args ...interface{})

func Warn

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

func WarnF

func WarnF(args ...interface{})

Types

type Logger

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

func CloneDefaultLog

func CloneDefaultLog(name string) *Logger

func GetDefaultLog

func GetDefaultLog() *Logger

func NewLogger

func NewLogger(logConfig LoggerConfig) *Logger

func (*Logger) CloneLogger

func (l *Logger) CloneLogger(name string) *Logger

func (*Logger) Debug

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

func (*Logger) DebugF

func (l *Logger) DebugF(args ...interface{})

func (*Logger) Error

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

func (*Logger) ErrorF

func (l *Logger) ErrorF(args ...interface{})

func (*Logger) Fatal

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

func (*Logger) FatalF

func (l *Logger) FatalF(args ...interface{})

func (*Logger) Info

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

func (*Logger) InfoF

func (l *Logger) InfoF(args ...interface{})

func (*Logger) Panic

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

func (*Logger) PanicF

func (l *Logger) PanicF(args ...interface{})

func (*Logger) Warn

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

func (*Logger) WarnF

func (l *Logger) WarnF(args ...interface{})

type LoggerConfig

type LoggerConfig struct {
	Level     zapcore.Level  `json:"level" toml:"level"`
	PathName  string         `json:"pathName" toml:"pathName" `
	Filename  string         `json:"filename" toml:"filename"`
	IsConsole bool           `json:"isConsole" toml:"isConsole"`
	IsFileNum bool           `json:"isFileNum" toml:"isFileNum"`
	Logs      map[string]int `json:"logs" toml:"logs"`
}

func NewDefaultLoggerConfig

func NewDefaultLoggerConfig() LoggerConfig

func (*LoggerConfig) FilenameOption

func (l *LoggerConfig) FilenameOption(filename string) Option

func (*LoggerConfig) IsConsoleOption

func (l *LoggerConfig) IsConsoleOption(isConsole bool) Option

func (*LoggerConfig) IsFileNumOption

func (l *LoggerConfig) IsFileNumOption(isFileNum bool) Option

func (*LoggerConfig) LevelOption

func (l *LoggerConfig) LevelOption(level zapcore.Level) Option

func (*LoggerConfig) PathNameOption

func (l *LoggerConfig) PathNameOption(pathName string) Option

func (*LoggerConfig) WithOptions

func (l *LoggerConfig) WithOptions(opts ...Option)

type Option

type Option interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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