Class: Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/smokey/logger.rb

Instance Method Summary collapse

Constructor Details

#initializeLogger

Returns a new instance of Logger.



5
6
7
# File 'lib/smokey/logger.rb', line 5

def initialize
  @redis = Redis.new
end

Instance Method Details

#log(type, item) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/smokey/logger.rb', line 9

def log(type, item)
  case type
    when "error"
      puts "ERROR - #{item}"
    when "success"
      puts "SUCCESS - #{item}"
    when "info"
      @redis.set("logje", "INFO - #{item}")
      storage = @redis.get("logje")
      puts storage
  end
end