Module: Migratrix::Loggable::ClassMethods

Defined in:
lib/migratrix/loggable.rb

Instance Method Summary collapse

Instance Method Details

#debug(msg) ⇒ Object



14
15
16
# File 'lib/migratrix/loggable.rb', line 14

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

#error(msg) ⇒ Object



20
21
22
# File 'lib/migratrix/loggable.rb', line 20

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

#fatal(msg) ⇒ Object



23
24
25
# File 'lib/migratrix/loggable.rb', line 23

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

#info(msg) ⇒ Object

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



11
12
13
# File 'lib/migratrix/loggable.rb', line 11

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

#loggerObject



7
8
9
# File 'lib/migratrix/loggable.rb', line 7

def logger
  ::Migratrix::Migratrix.logger
end

#warn(msg) ⇒ Object



17
18
19
# File 'lib/migratrix/loggable.rb', line 17

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