Module: Sequel::CallerLogging

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

Constant Summary collapse

SEQUEL_LIB_PATH =
(File.expand_path('../../..', __FILE__) + '/').freeze
RUBY_STDLIB =
RbConfig::CONFIG["rubylibdir"]
INTERNAL =
'<internal'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#caller_logging_formatterObject

A callable to format the external caller



46
47
48
# File 'lib/sequel/extensions/caller_logging.rb', line 46

def caller_logging_formatter
  @caller_logging_formatter
end

#caller_logging_ignoreObject

A regexp of caller lines to ignore, in addition to internal Sequel and Ruby code.



43
44
45
# File 'lib/sequel/extensions/caller_logging.rb', line 43

def caller_logging_ignore
  @caller_logging_ignore
end

Instance Method Details

#log_connection_yield(sql, conn, args = nil) ⇒ Object

Include caller information when logging query.



49
50
51
52
53
54
# File 'lib/sequel/extensions/caller_logging.rb', line 49

def log_connection_yield(sql, conn, args=nil)
  if !@loggers.empty? && (external_caller = external_caller_for_log)
    sql = "#{external_caller} #{sql}"
  end
  super
end