Documentation
¶
Index ¶
- Constants
- func BoolField(key string, value bool) zap.Field
- func Debug(msg string, fields ...zap.Field)
- func DebugCtx(ctx context.Context, msg string, fields ...zap.Field)
- func Debugf(format string, args ...any)
- func DebugfCtx(ctx context.Context, format string, args ...any)
- func Default() *zap.Logger
- func DurationField(key string, value time.Duration) zap.Field
- func Error(msg string, fields ...zap.Field)
- func ErrorCtx(ctx context.Context, msg string, fields ...zap.Field)
- func ErrorField(err error) zap.Field
- func Errorf(format string, args ...any)
- func ErrorfCtx(ctx context.Context, format string, args ...any)
- func Fatal(msg string, fields ...zap.Field)
- func Fatalf(format string, args ...any)
- func GenerateRequestID() string
- func GetContextFields(ctx context.Context) []zap.Field
- func Info(msg string, fields ...zap.Field)
- func InfoCtx(ctx context.Context, msg string, fields ...zap.Field)
- func Infof(format string, args ...any)
- func InfofCtx(ctx context.Context, format string, args ...any)
- func IntField(key string, value int) zap.Field
- func LogMCPToolComplete(ctx context.Context, toolName string, duration time.Duration, ...)
- func LogMCPToolError(ctx context.Context, toolName string, duration time.Duration, err error)
- func LogMCPToolStart(ctx context.Context, toolName string, params map[string]interface{})
- func Logger() *zap.Logger
- func Panic(msg string, fields ...zap.Field)
- func SanitizeURL(rawURL string) string
- func SanitizedURLField(key, rawURL string) zap.Field
- func SetDefault(logger *zap.Logger)
- func StringField(key, value string) zap.Field
- func Warn(msg string, fields ...zap.Field)
- func WarnCtx(ctx context.Context, msg string, fields ...zap.Field)
- func Warnf(format string, args ...any)
- func WarnfCtx(ctx context.Context, format string, args ...any)
- func WithMCPContext(ctx context.Context, toolName string) (context.Context, string)
- func WithOperation(ctx context.Context, operation string) context.Context
- func WithRequestID(ctx context.Context, requestID string) context.Context
Constants ¶
View Source
const ( RequestIDKey contextKey = "request_id" OperationKey contextKey = "operation" )
Variables ¶
This section is empty.
Functions ¶
func ErrorField ¶
func GenerateRequestID ¶
func GenerateRequestID() string
GenerateRequestID creates a new random request ID
func GetContextFields ¶
GetContextFields extracts logging fields from context
func LogMCPToolComplete ¶
func LogMCPToolComplete(ctx context.Context, toolName string, duration time.Duration, resultSummary string)
LogMCPToolComplete logs successful completion of an MCP tool execution
func LogMCPToolError ¶
LogMCPToolError logs failed MCP tool execution
func LogMCPToolStart ¶
LogMCPToolStart logs the start of an MCP tool execution
func SanitizeURL ¶
SanitizeURL removes sensitive information from URLs for logging
func SanitizedURLField ¶
func SetDefault ¶
func StringField ¶
Helper functions for common field types
func WithMCPContext ¶
WithMCPContext creates a new context with request ID and operation for MCP tool logging
func WithOperation ¶
WithOperation adds an operation name to the context
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.