sprinkle-tool / sprinkle

Sprinkle is a software provisioning tool you can use to build remote servers with. eg. to install a Rails, or Sinatra stack on a brand new slice directly after its been created
https://github.com/sprinkle-tool/sprinkle
MIT License
1.15k stars 138 forks source link

Show capistrano output as it was in 0.4.x #108

Closed ebeigarts closed 11 years ago

ebeigarts commented 11 years ago

The silent output was introduced in https://github.com/sprinkle-tool/sprinkle/commit/a6e7356318c41a6a67307932182ec8e51bce8b70#L0L91

ebeigarts commented 11 years ago

Currently it is very hard to tell what the sprinkle is doing, I have some packages that take 30+ minutes to complete, without the stdout visible it's hard to tell what is happening on the server.

joshgoebel commented 11 years ago

You should be more patient. LOL. :-)

What is ::Capistrano::Configuration.default_io_proc... that certainly wasn't there before... and I think full output should be reserved for verbose mode.

ebeigarts commented 11 years ago

::Capistrano::Configuration.default_io_proc is what capistrano uses as the default proc when no block is passed.

ebeigarts commented 11 years ago

See https://github.com/capistrano/capistrano/blob/master/lib/capistrano/configuration/actions/invocation.rb#L153

ebeigarts commented 11 years ago

I think later it should be placed somewhere else so that it works with all the actors. In another project I used this monkey patch, but I don't think LogRecorder is the right place to do this:

module Sprinkle::Utility
  # Even more verbose output
  LogRecorder.class_eval do
    alias :_log :log

    def log(stream, data)
      logger.info "  * #{stream}: #{data}" if data.present?
      _log(stream, data)
    end

    alias :_reset :reset
    def reset(cmd=nil)
      logger.info "  * executing #{cmd}" if cmd.present?
      _reset(cmd)
    end

    alias :_code= :code=
    def code=(value)
      logger.info "  * code: #{value}"
      send("_code=", value)
    end
  end
end