Class: ResponseLogger
- Inherits:
-
Object
- Object
- ResponseLogger
- Defined in:
- lib/veracodecli/log.rb
Instance Method Summary collapse
-
#initialize(log_path) ⇒ ResponseLogger
constructor
A new instance of ResponseLogger.
- #log(call, code, response) ⇒ Object
- #timestamp ⇒ Object
Constructor Details
#initialize(log_path) ⇒ ResponseLogger
5 6 7 |
# File 'lib/veracodecli/log.rb', line 5 def initialize(log_path) @path = log_path end |
Instance Method Details
#log(call, code, response) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/veracodecli/log.rb', line 9 def log(call, code, response) log = File.open "#{@path}/veracodecli.log", 'a+' log.write "#{call} called @ #{timestamp}" log.write "HTTP #{code}" log.write response log.write "\n" log.close end |
#timestamp ⇒ Object
18 19 20 |
# File 'lib/veracodecli/log.rb', line 18 def `date` end |