Module: SwaggerMCPTool::Logging

Included in:
ApiClient, Server, StdioServer
Defined in:
lib/swagger_mcp_tool/logging.rb

Overview

SwaggerMCPTool::Logging for logging-related methods and usage.

Instance Method Summary collapse

Instance Method Details

#log_and_raise_error(exception) ⇒ Object



20
21
22
23
# File 'lib/swagger_mcp_tool/logging.rb', line 20

def log_and_raise_error(exception)
  logger.error(exception.message)
  raise exception
end

#log_message(message) ⇒ Object



25
26
27
# File 'lib/swagger_mcp_tool/logging.rb', line 25

def log_message(message)
  logger.info(message)
end

#log_request_details(context) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/swagger_mcp_tool/logging.rb', line 29

def log_request_details(context)
  logger.debug 'API Request Details:'
  logger.debug "  Method: #{context[:method].upcase}"
  logger.debug "  Path: #{context[:original_path]}"
  logger.debug "  Params: #{context[:params].inspect}"
  logger.debug "  Headers: #{sanitize_headers_for_logging(context[:headers])}"
end

#log_request_execution(method, uri) ⇒ Object



37
38
39
# File 'lib/swagger_mcp_tool/logging.rb', line 37

def log_request_execution(method, uri)
  logger.info "Making #{method.upcase} request to #{uri.host}#{uri.path}"
end

#log_server_initializationObject



10
11
12
13
14
15
16
17
18
# File 'lib/swagger_mcp_tool/logging.rb', line 10

def log_server_initialization
  logger.info '=== SERVER INITIALIZATION ==='

  server_config_items.each do |label, value|
    logger.info "#{label}: #{value}"
  end

  logger.info '================================'
end