Module: AsktiveRecord::Log

Defined in:
lib/asktive_record/log.rb

Overview

Provides a configurable logging interface for AsktiveRecord. Defaults to Rails.logger when available, or a standard Logger to $stdout.

Usage:

AsktiveRecord.logger.info("Something happened")
AsktiveRecord.logger.debug("Debug info")

Constant Summary collapse

PREFIX =
"[AsktiveRecord]"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject



16
17
18
# File 'lib/asktive_record/log.rb', line 16

def logger
  @logger ||= default_logger
end

Class Method Details

.debug(message) ⇒ Object



26
27
28
# File 'lib/asktive_record/log.rb', line 26

def debug(message)
  logger.debug("#{PREFIX} #{message}")
end

.error(message) ⇒ Object



34
35
36
# File 'lib/asktive_record/log.rb', line 34

def error(message)
  logger.error("#{PREFIX} #{message}")
end

.info(message) ⇒ Object



22
23
24
# File 'lib/asktive_record/log.rb', line 22

def info(message)
  logger.info("#{PREFIX} #{message}")
end

.warn(message) ⇒ Object



30
31
32
# File 'lib/asktive_record/log.rb', line 30

def warn(message)
  logger.warn("#{PREFIX} #{message}")
end