Class: RubyLLM::MCP::Auth::BrowserOAuthProvider::SynchronizedLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_llm/mcp/auth/browser_oauth_provider.rb

Overview

Serializes logger calls so test doubles and non-thread-safe loggers remain safe when callback and main threads log at the same time.

Instance Method Summary collapse

Constructor Details

#initialize(logger) ⇒ SynchronizedLogger

Returns a new instance of SynchronizedLogger.



13
14
15
16
# File 'lib/ruby_llm/mcp/auth/browser_oauth_provider.rb', line 13

def initialize(logger)
  @logger = logger
  @mutex = Mutex.new
end

Instance Method Details

#debugObject



18
19
20
# File 'lib/ruby_llm/mcp/auth/browser_oauth_provider.rb', line 18

def debug(...)
  synchronized_log(:debug, ...)
end

#errorObject



30
31
32
# File 'lib/ruby_llm/mcp/auth/browser_oauth_provider.rb', line 30

def error(...)
  synchronized_log(:error, ...)
end

#infoObject



22
23
24
# File 'lib/ruby_llm/mcp/auth/browser_oauth_provider.rb', line 22

def info(...)
  synchronized_log(:info, ...)
end

#warnObject



26
27
28
# File 'lib/ruby_llm/mcp/auth/browser_oauth_provider.rb', line 26

def warn(...)
  synchronized_log(:warn, ...)
end