Module: EnhancedLogger::Sequel

Defined in:
lib/sequel/extensions/enhanced_logger.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



12
13
14
15
16
17
# File 'lib/sequel/extensions/enhanced_logger.rb', line 12

def self.extended(base)
  return if base.loggers.any?

  require "logger"
  base.loggers = [Logger.new("/dev/null")]
end

Instance Method Details

#log_duration(duration, _message) ⇒ Object



20
21
22
23
24
25
# File 'lib/sequel/extensions/enhanced_logger.rb', line 20

def log_duration(duration, _message)
  Roda::EnhancedLogger::Current.increment_accrued_database_time(duration)
  Roda::EnhancedLogger::Current.increment_database_query_count

  super
end

#skip_logging?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/sequel/extensions/enhanced_logger.rb', line 8

def skip_logging?
  false
end