Class: Circus::Agents::DBusLogger

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

Instance Method Summary collapse

Constructor Details

#initialize(adapter, action_id) ⇒ DBusLogger

Returns a new instance of DBusLogger.



4
5
6
7
# File 'lib/circus/agents/dbus_logger.rb', line 4

def initialize(adapter, action_id)
  @adapter = adapter
  @action_id = action_id
end

Instance Method Details

#complete(res = nil) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/circus/agents/dbus_logger.rb', line 21

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

#error(content) ⇒ Object



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

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

#failed(msg) ⇒ Object



17
18
19
# File 'lib/circus/agents/dbus_logger.rb', line 17

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

#info(content) ⇒ Object



9
10
11
# File 'lib/circus/agents/dbus_logger.rb', line 9

def info(content)
  write(content)
end

#write(msg) ⇒ Object



29
30
31
# File 'lib/circus/agents/dbus_logger.rb', line 29

def write(msg)
  @adapter.LogEntry(@action_id, msg)
end