MCPcopy
hub / github.com/modelcontextprotocol/python-sdk / send_log_message

Method send_log_message

src/mcp/server/session.py:103–120  ·  view source on GitHub ↗

Send a log message notification.

(
        self,
        level: types.LoggingLevel,
        data: Any,
        logger: str | None = None,
        related_request_id: types.RequestId | None = None,
    )

Source from the content-addressed store, hash-verified

101
102 @deprecated("The logging capability is deprecated as of 2026-07-28 (SEP-2577).", category=MCPDeprecationWarning)
103 async def send_log_message(
104 self,
105 level: types.LoggingLevel,
106 data: Any,
107 logger: str | None = None,
108 related_request_id: types.RequestId | None = None,
109 ) -> None:
110 """Send a log message notification."""
111 await self.send_notification(
112 types.LoggingMessageNotification(
113 params=types.LoggingMessageNotificationParams(
114 level=level,
115 data=data,
116 logger=logger,
117 ),
118 ),
119 related_request_id,
120 )
121
122 async def send_resource_updated(self, uri: str | AnyUrl) -> None:
123 """Send a resource updated notification."""

Callers 11

logMethod · 0.80
_handle_call_toolFunction · 0.80
handle_call_toolFunction · 0.80
call_toolFunction · 0.80
call_toolFunction · 0.80
call_toolFunction · 0.80
call_toolFunction · 0.80
handle_call_toolFunction · 0.80
handle_call_toolFunction · 0.80
handle_call_toolFunction · 0.80

Calls 1

send_notificationMethod · 0.95

Tested by 6

_handle_call_toolFunction · 0.64
handle_call_toolFunction · 0.64
call_toolFunction · 0.64
call_toolFunction · 0.64
call_toolFunction · 0.64