Class: Circus::Agents::XMPPLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/circus/agents/logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(to, thread, writer) ⇒ XMPPLogger

Returns a new instance of XMPPLogger.



7
8
9
10
11
# File 'lib/circus/agents/logger.rb', line 7

def initialize(to, thread, writer)
  @to = to
  @thread = thread || "thread#{Blather::Stanza.next_id}"
  @writer = writer
end

Instance Method Details

#complete(res = nil) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/circus/agents/logger.rb', line 27

def complete(res = nil)
  if res
    write("ok #{Encoding.encode(res)}") 
  else
    write('ok')
  end
  gone
end

#error(content) ⇒ Object



18
19
20
# File 'lib/circus/agents/logger.rb', line 18

def error(content)
  write("ERROR: #{content}")
end

#failed(msg) ⇒ Object



22
23
24
25
# File 'lib/circus/agents/logger.rb', line 22

def failed(msg)
  write("failed #{msg}")
  gone
end

#info(content) ⇒ Object



13
14
15
# File 'lib/circus/agents/logger.rb', line 13

def info(content)
  write("#{content}")
end