@@ -66,9 +66,9 @@ final class Registry implements ReferenceProviderInterface, ReferenceRegistryInt
6666
6767 private ServerCapabilities $ serverCapabilities ;
6868
69- private bool $ loggingMessageNotificationEnabled = false ;
69+ private bool $ logging = true ;
7070
71- private ? LoggingLevel $ currentLoggingMessageNotificationLevel = null ;
71+ private LoggingLevel $ loggingLevel = LoggingLevel::Warning ;
7272
7373 public function __construct (
7474 private readonly ?EventDispatcherInterface $ eventDispatcher = null ,
@@ -77,21 +77,21 @@ public function __construct(
7777 }
7878
7979 /**
80- * Enables logging message notifications for this registry.
80+ * Disable logging message notifications for this registry.
8181 */
82- public function enableLoggingMessageNotification (): void
82+ public function disableLogging (): void
8383 {
84- $ this ->loggingMessageNotificationEnabled = true ;
84+ $ this ->logging = false ;
8585 }
8686
8787 /**
8888 * Checks if logging message notification capability is enabled.
8989 *
90- * @return bool True if logging message notification capability is enabled, false otherwise
90+ * @return bool True if logging capability is enabled, false otherwise
9191 */
92- public function isLoggingMessageNotificationEnabled (): bool
92+ public function isLoggingEnabled (): bool
9393 {
94- return $ this ->loggingMessageNotificationEnabled ;
94+ return $ this ->logging ;
9595 }
9696
9797 /**
@@ -100,19 +100,19 @@ public function isLoggingMessageNotificationEnabled(): bool
100100 * This determines which log messages should be sent to the client.
101101 * Only messages at this level and higher (more severe) will be sent.
102102 */
103- public function setLoggingMessageNotificationLevel (LoggingLevel $ level ): void
103+ public function setLoggingLevel (LoggingLevel $ level ): void
104104 {
105- $ this ->currentLoggingMessageNotificationLevel = $ level ;
105+ $ this ->loggingLevel = $ level ;
106106 }
107107
108108 /**
109109 * Gets the current logging message notification level set by the client.
110110 *
111- * @return LoggingLevel|null The current log level, or null if not set
111+ * @return LoggingLevel The current log level
112112 */
113- public function getLoggingMessageNotificationLevel (): ? LoggingLevel
113+ public function getLoggingLevel (): LoggingLevel
114114 {
115- return $ this ->currentLoggingMessageNotificationLevel ;
115+ return $ this ->loggingLevel ;
116116 }
117117
118118 public function getCapabilities (): ServerCapabilities
@@ -129,7 +129,7 @@ public function getCapabilities(): ServerCapabilities
129129 resourcesListChanged: $ this ->eventDispatcher instanceof EventDispatcherInterface,
130130 prompts: [] !== $ this ->prompts ,
131131 promptsListChanged: $ this ->eventDispatcher instanceof EventDispatcherInterface,
132- logging: $ this ->loggingMessageNotificationEnabled ,
132+ logging: $ this ->logging ,
133133 completions: true ,
134134 );
135135 }
0 commit comments