Class: MCP::LoggingMessageNotification
- Inherits:
-
Object
- Object
- MCP::LoggingMessageNotification
- Defined in:
- lib/mcp/logging_message_notification.rb
Constant Summary collapse
- LOG_LEVEL_SEVERITY =
{ "debug" => 0, "info" => 1, "notice" => 2, "warning" => 3, "error" => 4, "critical" => 5, "alert" => 6, "emergency" => 7, }.freeze
Instance Method Summary collapse
-
#initialize(level:) ⇒ LoggingMessageNotification
constructor
A new instance of LoggingMessageNotification.
- #should_notify?(log_level) ⇒ Boolean
- #valid_level? ⇒ Boolean
Constructor Details
#initialize(level:) ⇒ LoggingMessageNotification
Returns a new instance of LoggingMessageNotification.
16 17 18 |
# File 'lib/mcp/logging_message_notification.rb', line 16 def initialize(level:) @level = level end |
Instance Method Details
#should_notify?(log_level) ⇒ Boolean
24 25 26 27 28 |
# File 'lib/mcp/logging_message_notification.rb', line 24 def should_notify?(log_level) return false unless LOG_LEVEL_SEVERITY.key?(log_level) LOG_LEVEL_SEVERITY[log_level] >= LOG_LEVEL_SEVERITY[@level] end |
#valid_level? ⇒ Boolean
20 21 22 |
# File 'lib/mcp/logging_message_notification.rb', line 20 def valid_level? LOG_LEVEL_SEVERITY.keys.include?(@level) end |