{"action":"created","issue":{"url":"https://api.github.com/repos/capistrano/capistrano/issues/1458","labels_url":"https://api.github.com/repos/capistrano/capistrano/issues/1458/labels{/name}","comments_url":"https://api.github.com/repos/capistrano/capistrano/issues/1458/comments","events_url":"https://api.github.com/repos/capistrano/capistrano/issues/1458/events","html_url":"https://github.com/capistrano/capistrano/issues/1458","id":94001045,"number":1458,"title":"Capturing capistrano 3 output.","user":{"login":"BenjaminKim","id":597114,"avatar_url":"https://avatars.githubusercontent.com/u/597114?v=3","gravatar_id":"","url":"https://api.github.com/users/BenjaminKim","html_url":"https://github.com/BenjaminKim","followers_url":"https://api.github.com/users/BenjaminKim/followers","following_url":"https://api.github.com/users/BenjaminKim/following{/other_user}","gists_url":"https://api.github.com/users/BenjaminKim/gists{/gist_id}","starred_url":"https://api.github.com/users/BenjaminKim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenjaminKim/subscriptions","organizations_url":"https://api.github.com/users/BenjaminKim/orgs","repos_url":"https://api.github.com/users/BenjaminKim/repos","events_url":"https://api.github.com/users/BenjaminKim/events{/privacy}","received_events_url":"https://api.github.com/users/BenjaminKim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-09T09:30:25Z","updated_at":"2015-07-09T09:48:34Z","closed_at":null,"body":"```ruby\r\nnamespace :deploy do\r\n  desc 'Notify to co-workers'\r\n  task :notify do\r\n    summury = \"[#{fetch(:application)}](#{fetch(:stage)}) \" + revision_log_message\r\n    Mail.send_one(summury, 'my-team-mail-address@team.com')\r\n  end\r\n\r\n  task :notify_with_full_log do\r\n    full_log = get_capistrano_full_log # here\r\n    Mail.send_one(full_log, 'my-team-mail-address@team.com')\r\n  end\r\nend\r\n```\r\n\r\nI made my own task `deploy:notify` to notify deployment to my coworkers and it works well.\r\nI would also want to make `deploy:notify_with_full_log` task but I can't find the way yet.\r\nIs there a method or way to do this?"},"comment":{"url":"https://api.github.com/repos/capistrano/capistrano/issues/comments/119892646","html_url":"https://github.com/capistrano/capistrano/issues/1458#issuecomment-119892646","issue_url":"https://api.github.com/repos/capistrano/capistrano/issues/1458","id":119892646,"user":{"login":"leehambley","id":18952,"avatar_url":"https://avatars.githubusercontent.com/u/18952?v=3","gravatar_id":"","url":"https://api.github.com/users/leehambley","html_url":"https://github.com/leehambley","followers_url":"https://api.github.com/users/leehambley/followers","following_url":"https://api.github.com/users/leehambley/following{/other_user}","gists_url":"https://api.github.com/users/leehambley/gists{/gist_id}","starred_url":"https://api.github.com/users/leehambley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leehambley/subscriptions","organizations_url":"https://api.github.com/users/leehambley/orgs","repos_url":"https://api.github.com/users/leehambley/repos","events_url":"https://api.github.com/users/leehambley/events{/privacy}","received_events_url":"https://api.github.com/users/leehambley/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T09:48:34Z","updated_at":"2015-07-09T09:48:34Z","body":"Hi @BenjaminKim the formatters (take a look) for Capistrano live in SSHKit, mostly - and they take a standard `IO` - typically this is set to $stdout, but you could easily wrap $stdout in something else that responds to `#write`, and keeps a copy. The formatters don't always receive plain strings, they receive `Command` objects, and whatever else, and they make decisions about how to print them, you might take a look at https://github.com/mattbrictson/airbrussh for some inspiration, although you wouldn't have to go anywhere near that far, simply keep a copy of each thing that is written to your output, and then do something with it to render it for the user. That might mean that you do the same thing (mostly, just call `.to_s` on everything you receive, or you might want to do something cleverer, to make it into HTML or strip the colours/formatting for email display."}}