Module: DataObjects::Logging

Included in:
Connection
Defined in:
lib/data_objects/logger.rb

Instance Method Summary collapse

Instance Method Details

#log(message) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/data_objects/logger.rb', line 7

def log(message)
  logger = driver_namespace.logger
  if logger.level <= DataObjects::Logger::LEVELS[:debug]
    message = "(%.6f) %s" % [message.duration / 1000000.0, message.query]
    logger.debug message
  end
end