Module: Migratrix::Loggable::InstanceMethods

Defined in:
lib/migratrix/loggable.rb

Instance Method Summary collapse

Instance Method Details

#debug(msg) ⇒ Object



37
38
39
# File 'lib/migratrix/loggable.rb', line 37

def debug(msg)
  logger.debug("#{self.class}: #{msg}")
end

#error(msg) ⇒ Object



43
44
45
# File 'lib/migratrix/loggable.rb', line 43

def error(msg)
  logger.error("#{self.class}: #{msg}")
end

#fatal(msg) ⇒ Object



46
47
48
# File 'lib/migratrix/loggable.rb', line 46

def fatal(msg)
  logger.fatal("#{self.class}: #{msg}")
end

#info(msg) ⇒ Object

If you skip the logger object, your class name will be prepended to the message.



34
35
36
# File 'lib/migratrix/loggable.rb', line 34

def info(msg)
  logger.info("#{self.class}: #{msg}")
end

#loggerObject



29
30
31
# File 'lib/migratrix/loggable.rb', line 29

def logger
  ::Migratrix::Migratrix.logger
end

#warn(msg) ⇒ Object



40
41
42
# File 'lib/migratrix/loggable.rb', line 40

def warn(msg)
  logger.warn("#{self.class}: #{msg}")
end