Documentation
¶
Index ¶
- func Debug(ctx context.Context, message string, fields ...interface{})
- func Debugf(ctx context.Context, format string, args ...interface{})
- func Error(ctx context.Context, message string, fields ...interface{})
- func Errorf(ctx context.Context, format string, args ...interface{})
- func Fatal(ctx context.Context, message string, fields ...interface{})
- func Fatalf(ctx context.Context, format string, args ...interface{})
- func GetDebugID(ctx context.Context) string
- func GetRequestID(ctx context.Context) string
- func GetTraceID(ctx context.Context) string
- func GetUserID(ctx context.Context) string
- func Info(ctx context.Context, message string, fields ...interface{})
- func Infof(ctx context.Context, format string, args ...interface{})
- func Init(level string) error
- func InitDevelopment() error
- func Warn(ctx context.Context, message string, fields ...interface{})
- func Warnf(ctx context.Context, format string, args ...interface{})
- func WithDebugID(ctx context.Context, debugID string) context.Context
- func WithLogContext(ctx context.Context, requestID, traceID, userID string) context.Context
- func WithRequestID(ctx context.Context, requestID string) context.Context
- func WithTraceID(ctx context.Context, traceID string) context.Context
- func WithUserID(ctx context.Context, userID string) context.Context
- type Logger
- func (l *Logger) Debug(ctx context.Context, message string, fields ...interface{})
- func (l *Logger) Debugf(ctx context.Context, format string, args ...interface{})
- func (l *Logger) Error(ctx context.Context, message string, fields ...interface{})
- func (l *Logger) Errorf(ctx context.Context, format string, args ...interface{})
- func (l *Logger) Fatal(ctx context.Context, message string, fields ...interface{})
- func (l *Logger) Fatalf(ctx context.Context, format string, args ...interface{})
- func (l *Logger) Info(ctx context.Context, message string, fields ...interface{})
- func (l *Logger) Infof(ctx context.Context, format string, args ...interface{})
- func (l *Logger) Sync() error
- func (l *Logger) Warn(ctx context.Context, message string, fields ...interface{})
- func (l *Logger) Warnf(ctx context.Context, format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDebugID ¶
GetDebugID retrieves debug ID from context (uses debug package)
func GetRequestID ¶
GetRequestID retrieves request ID from context
func GetTraceID ¶
GetTraceID retrieves trace ID from context
func InitDevelopment ¶
func InitDevelopment() error
InitDevelopment initializes the logger in development mode with pretty printing
func WithDebugID ¶
WithDebugID adds debug ID to context (uses debug package)
func WithLogContext ¶
WithLogContext sets multiple context values at once
func WithRequestID ¶
WithRequestID adds request ID to context
func WithTraceID ¶
WithTraceID adds trace ID to context
Types ¶
type Logger ¶
Logger wraps zap.Logger with context-aware logging
Click to show internal directories.
Click to hide internal directories.