Class: Watsbot::Logger

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/watsbot/logger.rb

Instance Method Summary collapse

Instance Method Details

#debug(path, message) ⇒ Object



8
9
10
# File 'lib/watsbot/logger.rb', line 8

def debug(path, message)
  ::Logger.new(make_log_file(path), "daily").debug(message)
end

#error(path, message) ⇒ Object



12
13
14
# File 'lib/watsbot/logger.rb', line 12

def error(path, message)
  ::Logger.new(make_log_file(path), "daily").error(message)
end

#info(path, message) ⇒ Object



16
17
18
# File 'lib/watsbot/logger.rb', line 16

def info(path, message)
  ::Logger.new(make_log_file(path), "daily").info(message)
end

#raw_log(path, message) ⇒ Object



24
25
26
27
# File 'lib/watsbot/logger.rb', line 24

def raw_log(path, message)
  full_path = make_log_file(path)
  File.open(full_path, "a+") { |f| f.puts("R, [#{DateTime.now.as_json}]  RAW -- : " + message) }
end

#warn(path, message) ⇒ Object



20
21
22
# File 'lib/watsbot/logger.rb', line 20

def warn(path, message)
  ::Logger.new(make_log_file(path), "daily").warn(message)
end