Module: Capybara::Lockstep::Logging

Included in:
Capybara::Lockstep, Client, Server
Defined in:
lib/capybara-lockstep/logging.rb

Instance Method Summary collapse

Instance Method Details

#log(message) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/capybara-lockstep/logging.rb', line 4

def log(message)
  if Lockstep.debug? && message.present?
    message = "[capybara-lockstep] #{message}"
    if is_logger?(Lockstep.debug)
      # If someone set Capybara::Lockstep.debug to a logger, use that
      Lockstep.debug.debug(message)
    else
      # Otherwise print to STDOUT
      puts message
    end
  end
end