zaplogger

package
v0.0.0-...-444e761 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const LevelFlagHelp = "Log level, default is info. One of: [debug, info, warn, error]"
View Source
const LevelFlagName = "log.level"
View Source
const LogMaxBackupsFlagHelp = "The maximum number of old log files to retain. Default is 5."
View Source
const LogMaxBackupsFlagName = "log.max-backups"
View Source
const LogMaxDaysFlagHelp = "The maximum number of days to retain old log files. Default is 30"
View Source
const LogMaxDaysFlagName = "log.max-days"
View Source
const RunModeFlagHelp = "Running Mode,default is release. One of: [dev, debug, release]"
View Source
const RunModeFlagName = "running.mode"

Variables

This section is empty.

Functions

func ConfigZap

func ConfigZap(serverName string, runConf *RunningConfig) zap.Config

func NewZapLogger

func NewZapLogger(config zap.Config) *zap.Logger

Types

type Level

type Level int
const (
	Debug Level = iota + 1
	Info
	Warn
	Error
	Panic
)

type LogLevel

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

func (*LogLevel) Level

func (l *LogLevel) Level() Level

func (*LogLevel) Set

func (l *LogLevel) Set(s string) error

func (*LogLevel) String

func (l *LogLevel) String() string

type RunMode

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

func (*RunMode) Set

func (r *RunMode) Set(s string) error

func (*RunMode) String

func (r *RunMode) String() string

type RunningConfig

type RunningConfig struct {
	Level      *LogLevel
	RunMode    *RunMode
	MaxBackups int
	MaxDays    int
}

func NewRunConf

func NewRunConf(level, mode string, maxdays, maxbackups int) *RunningConfig

type ZapLogger

type ZapLogger struct {
	*zap.SugaredLogger
}

func NewZapSugarLogger

func NewZapSugarLogger(config zap.Config) *ZapLogger

func NewZapSugarLoggerGin

func NewZapSugarLoggerGin(config zap.Config) *ZapLogger

func (ZapLogger) Debug

func (l ZapLogger) Debug(module string, data interface{})

func (ZapLogger) Error

func (l ZapLogger) Error(module string, data interface{})

func (ZapLogger) Fatal

func (l ZapLogger) Fatal(module string, data interface{})

func (ZapLogger) Info

func (l ZapLogger) Info(module string, data interface{})

func (ZapLogger) Panic

func (l ZapLogger) Panic(module string, data interface{})

func (ZapLogger) Warn

func (l ZapLogger) Warn(module string, data interface{})

Jump to

Keyboard shortcuts

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