Class: Astrobot::Logger
- Inherits:
-
Object
- Object
- Astrobot::Logger
- Defined in:
- lib/astrobot/logger.rb
Class Method Summary collapse
Class Method Details
.add(message) ⇒ Object
3 4 5 |
# File 'lib/astrobot/logger.rb', line 3 def self.add() Kernel.puts "[TransmissionApi #{Time.now.strftime( "%F %T" )}] #{}" if Astrobot.config[:debug_mode] end |
.debug(response) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/astrobot/logger.rb', line 7 def self.debug(response) body = nil begin body = JSON.parse(response.body).to_yaml rescue body = response.body end headers = response.headers.to_yaml add "response.code: #{response.code}" add "response.message: #{response.}" add "response.body:" add body add "-----------------" add "response.headers:" add headers add "------------------" end |