Documentation
¶
Index ¶
- Constants
- func Debug(message string, fields ...zap.Field)
- func DebugCtx(ctx context.Context, message string, fields ...zap.Field)
- func Error(message string, fields ...zap.Field)
- func ErrorCtx(ctx context.Context, message string, fields ...zap.Field)
- func Fatal(message string, fields ...zap.Field)
- func FatalCtx(ctx context.Context, message string, fields ...zap.Field)
- func Info(message string, fields ...zap.Field)
- func InfoCtx(ctx context.Context, message string, fields ...zap.Field)
- func RegisterLogHandler(handler LogHandler)
- func Setup(cfg *Config) *zap.Logger
- func Warn(message string, fields ...zap.Field)
- func WarnCtx(ctx context.Context, message string, fields ...zap.Field)
- func WithField(ctx context.Context, field zap.Field) context.Context
- func WithFields(ctx context.Context, fields ...zap.Field) context.Context
- type Config
- type LogEntry
- type LogHandler
Constants ¶
View Source
const ( LevelDefault = levelInfo EnvironmentDevelopment = "development" EnvironmentProduction = "production" EnvironmentDefault = EnvironmentProduction )
Variables ¶
This section is empty.
Functions ¶
func RegisterLogHandler ¶
func RegisterLogHandler(handler LogHandler)
Types ¶
type Config ¶
Config is a logger configuration structure.
func DefaultConfig ¶
func DefaultConfig() *Config
func (*Config) GetLogLevel ¶
type LogHandler ¶ added in v1.6.7
type LogHandler func(entry *LogEntry)
LogHandler is the callback function that can be used for handling log entries
func SentryErrorLogHandler ¶ added in v1.6.7
func SentryErrorLogHandler() LogHandler
SentryErrorLogHandler sends the first error from entry fields to Sentry
Click to show internal directories.
Click to hide internal directories.