MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / Handle

Method Handle

mcp/logging.go:151–156  ·  view source on GitHub ↗

Handle implements [slog.Handler.Handle] by writing the Record to a JSONHandler, then calling [ServerSession.LoggingMessage] with the result.

(ctx context.Context, r slog.Record)

Source from the content-addressed store, hash-verified

149// Handle implements [slog.Handler.Handle] by writing the Record to a JSONHandler,
150// then calling [ServerSession.LoggingMessage] with the result.
151func (h *LoggingHandler) Handle(ctx context.Context, r slog.Record) error {
152 err := h.handle(ctx, r)
153 // TODO(jba): find a way to surface the error.
154 // The return value will probably be ignored.
155 return err
156}
157
158func (h *LoggingHandler) handle(ctx context.Context, r slog.Record) error {
159 // Observe the rate limit.

Callers

nothing calls this directly

Calls 1

handleMethod · 0.95

Tested by

no test coverage detected