Class: Watsbot::Logger
- Inherits:
-
Object
- Object
- Watsbot::Logger
- Includes:
- Singleton
- Defined in:
- lib/watsbot/logger.rb
Instance Method Summary collapse
- #debug(path, message) ⇒ Object
- #error(path, message) ⇒ Object
- #info(path, message) ⇒ Object
- #raw_log(path, message) ⇒ Object
- #warn(path, message) ⇒ Object
Instance Method Details
#debug(path, message) ⇒ Object
8 9 10 |
# File 'lib/watsbot/logger.rb', line 8 def debug(path, ) ::Logger.new(make_log_file(path), "daily").debug() end |
#error(path, message) ⇒ Object
12 13 14 |
# File 'lib/watsbot/logger.rb', line 12 def error(path, ) ::Logger.new(make_log_file(path), "daily").error() end |
#info(path, message) ⇒ Object
16 17 18 |
# File 'lib/watsbot/logger.rb', line 16 def info(path, ) ::Logger.new(make_log_file(path), "daily").info() end |
#raw_log(path, message) ⇒ Object
24 25 26 27 |
# File 'lib/watsbot/logger.rb', line 24 def raw_log(path, ) full_path = make_log_file(path) File.open(full_path, "a+") { |f| f.puts("R, [#{DateTime.now.as_json}] RAW -- : " + ) } end |
#warn(path, message) ⇒ Object
20 21 22 |
# File 'lib/watsbot/logger.rb', line 20 def warn(path, ) ::Logger.new(make_log_file(path), "daily").warn() end |