Module: PicFisher::Log

Defined in:
lib/picfisher/log.rb

Overview

Print a message to the console

Examples:

PicFisher::Log.debug("message")
PicFisher::Log.info("message")
PicFisher::Log.error("message")

Returns:

  • (nil)

Class Method Summary collapse

Class Method Details

.debug(message) ⇒ Object



12
13
14
# File 'lib/picfisher/log.rb', line 12

def self.debug(message)
  output(:debug, message) if ["debug"].include? debug_level
end

.error(message) ⇒ Object



20
21
22
# File 'lib/picfisher/log.rb', line 20

def self.error(message)
  output(:error, message) if %w[debug info error].include? debug_level
end

.info(message) ⇒ Object



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

def self.info(message)
  output(:info, message) if %w[debug info].include? debug_level
end

.output(level, message) ⇒ Object



24
25
26
27
# File 'lib/picfisher/log.rb', line 24

def self.output(level, message)
  final_message = "PicFisher [#{level.upcase}] #{message}"
  Kernel.puts(final_message)
end