Documentation ¶
Index ¶
- Variables
- func Debug(ctx context.Context, msg string, fields ...Field)
- func Debugf(msg string, fields ...Field)
- func Error(ctx context.Context, msg string, fields ...Field)
- func Errorf(msg string, fields ...Field)
- func Info(ctx context.Context, msg string, fields ...Field)
- func Infof(msg string, fields ...Field)
- func Json(obj interface{}) string
- func JsonBytes(obj interface{}) []byte
- func JsonForm(form url.Values) []byte
- func Panic(ctx context.Context, msg string, fields ...Field)
- func Panicf(msg string, fields ...Field)
- func Warn(ctx context.Context, msg string, fields ...Field)
- func Warnf(msg string, fields ...Field)
- type Config
- type Field
- type Logger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // String is an alias of zap.String String = zap.String // Bytes is an alias of zap.Bytes Bytes = zap.ByteString // Duration is an alias of zap.Duration Duration = zap.Duration // Int8 is an alias of zap.Int8 Int8 = zap.Int8 // Int32 is an alias of zap.Int32 Int32 = zap.Int32 // Int is an alias of zap.Int Int = zap.Int // Int64 is an alias of zap.Int64 Int64 = zap.Int64 // Uint8 is an alias of zap.Uint8 Uint8 = zap.Uint8 // Uint32 is an alias of zap.Uint32 Uint32 = zap.Uint32 // Uint is an alias of zap.Uint Uint = zap.Uint // Uint64 is an alias of zap.Uint64 Uint64 = zap.Uint64 // Float64 is an alias of zap.Float64 Float64 = zap.Float64 // Any is an alias of zap.Any Any = zap.Any )
Functions ¶
func Debugf ¶
Debugf logs are typically voluminous without context and are usually disabled in production
func Error ¶
Error logs are high-priority. If an application is running smoothly, it shouldn't generate any error-Level logs
func Errorf ¶
Errorf logs are high-priority without context If an application is running smoothly, it shouldn't generate any error-Level logs.
Types ¶
type Config ¶
type Config struct { // Dir log output directory Dir string // Name log output file name Name string // Level log level Level string // CallerSkip log depth CallerSkip int // FlushInterval log flush interval FlushInterval time.Duration // Debug log mode, default true Debug bool // WatchConfig whether watch config file changes WatchConfig bool // EnableAsyncLog whether flush log async EnableAsyncLog bool // DisableStacktrace where log stack details if run into error DisableStacktrace bool // MaxSize max size of log file, it'll rotate log automatically if exceed the max size MaxSize int // MaxAge max duration of store logs MaxAge int // MaxBackup max files of backup logs MaxBackup int // Sensitives filter keywords Sensitives []string // Placeholder filter keyword replacement Placeholder string }
Config log configs
Click to show internal directories.
Click to hide internal directories.