Class: Saper::Logger

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io = nil) ⇒ Logger


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

def initialize(io = nil)
  @io = io || StringIO.new
end

Instance Attribute Details

#ioObject (readonly)

TODO: requires serious overhaul


6
7
8
# File 'lib/saper/core/logger.rb', line 6

def io
  @io
end

Instance Method Details

#executing_recipe(recipe) ⇒ Object


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

def executing_recipe(recipe)
  io.write "Executing recipe: %s\n" % recipe.id
end

#new_browser(browser) ⇒ Object


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

def new_browser(browser)
  io.write "New browser: %s\n" % browser.agent
end

#new_get_request(url) ⇒ Object


24
25
26
# File 'lib/saper/core/logger.rb', line 24

def new_get_request(url)
  io.write "Getting %s\n" % url
end

#new_post_request(url) ⇒ Object


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

def new_post_request(url)
  io.write "Posting to %s\n" % url
end