Hi,

I have not been using capistrano for a whole lot just yet, but for
executing the few remote commands I've been doing, I've found buffering
the return output per line to be a lot easier to read:

    # Buffer capistrano output per line
    Capistrano::Actor.default_io_proc = Proc.new do |ch, stream, out|
      ch[stream] ||= ''
      ch[stream] << out
      if out[-1..-1] == "\n"
        level = stream == :err ? :important : :info
        ch[:actor].logger.send(level, ch[stream], "#{stream} :: #{ch[:host]}")
        ch[stream] = ''
      end
    end

I must admit its been a few weeks since I wrote this, but as I recall it
turned the output I was seeing from:

    out :: host1 Restarting daemon
    out :: host1 [OK]
    out :: host1 ...
    out :: host2 Restarting daemon
    out :: host2 [OK]
    out :: host2 ...

To just:

    out :: host1 Restarting daemon [OK]
    out :: host2 Restarting daemon [OK]

I would almost suggest this as a patch, but just because its desirable
for my situation, I don't know if its desirable for all situations.

- Stephen


--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to