Class: ActionMCP::FilteredLogger
- Inherits:
-
ActiveSupport::Logger
- Object
- ActiveSupport::Logger
- ActionMCP::FilteredLogger
- Defined in:
- lib/action_mcp/filtered_logger.rb
Overview
Custom logger that filters out repetitive MCP requests
Constant Summary collapse
- FILTERED_PATHS =
[].freeze
- FILTERED_METHODS =
[ "notifications/initialized", "notifications/ping" ].freeze
Instance Method Summary collapse
Instance Method Details
#add(severity, message = nil, progname = nil, &block) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/action_mcp/filtered_logger.rb', line 13 def add(severity, = nil, progname = nil, &block) # Filter out specific paths if .is_a?(String) return if FILTERED_PATHS.any? { |path| .include?(path) && .include?("200 OK") } # Filter out repetitive MCP notifications return if FILTERED_METHODS.any? { |method| .include?(method) } # Filter out MCP protocol version debug messages return if .include?("MCP-Protocol-Version header validation passed") end super end |