Module: Logification::Helpers::LoggingMethods

Included in:
Logger
Defined in:
lib/logification/helpers/logging_methods.rb

Constant Summary collapse

TAB =
"    "

Instance Method Summary collapse

Instance Method Details

#debug(msg = nil) ⇒ Object



9
10
11
12
# File 'lib/logification/helpers/logging_methods.rb', line 9

def debug(msg=nil)
  msg = yield if block_given?
  log_message(:debug, msg, :green)
end

#error(msg = nil) ⇒ Object



24
25
26
27
# File 'lib/logification/helpers/logging_methods.rb', line 24

def error(msg=nil)
  msg = yield if block_given?
  log_message(:error, msg, :red)
end

#fatal(msg = nil) ⇒ Object



29
30
31
32
# File 'lib/logification/helpers/logging_methods.rb', line 29

def fatal(msg=nil)
  msg = yield if block_given?
  log_message(:fatal, msg, :magenta)
end

#info(msg = nil) ⇒ Object



14
15
16
17
# File 'lib/logification/helpers/logging_methods.rb', line 14

def info(msg=nil)
  msg = yield if block_given?
  log_message(:info, msg, :cyan)
end

#warn(msg = nil) ⇒ Object



19
20
21
22
# File 'lib/logification/helpers/logging_methods.rb', line 19

def warn(msg=nil)
  msg = yield if block_given?
  log_message(:warn, msg, :yellow)
end