Documentation
¶
Index ¶
- func DebugCtx(ctx context.Context, msg string, fields ...zap.Field)
- func ErrorCtx(ctx context.Context, msg string, fields ...zap.Field)
- func GenerateLogID() string
- func InfoCtx(ctx context.Context, msg string, fields ...zap.Field)
- func New(cfg *Config)
- func Sync() error
- func WarnCtx(ctx context.Context, msg string, fields ...zap.Field)
- type Config
- type FileConfig
- type Logger
- type LoggerLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateLogID ¶
func GenerateLogID() string
Types ¶
type Config ¶
type Config struct {
File FileConfig `json:"enable_file"`
Level LoggerLevel `json:"level"`
Caller bool `json:"caller"`
DefaultTags map[string]interface{}
}
type FileConfig ¶
type LoggerLevel ¶
type LoggerLevel string
const ( // LoggerLevelDebug is the debug level LoggerLevelDebug LoggerLevel = "debug" // LoggerLevelInfo is the info level LoggerLevelInfo LoggerLevel = "info" // LoggerLevelWarn is the warn level LoggerLevelWarn LoggerLevel = "warn" // LoggerLevelError is the error level LoggerLevelError LoggerLevel = "error" )
Click to show internal directories.
Click to hide internal directories.