You could tee stdout and stderr to a log:

class TeeIO < IO

  def initialize orig, file
    @orig = orig
    @file = file
  end

  def write string
    @file.write string
    @orig.write string
  end
end

In Rakefile:

tee = TeeIO.new $stdout, File.new('log/rake.log', 'w+')
$stdout = tee


-- 
Rob Kaufman

On July 25, 2016 at 18:06:26, Adam + Cuppy ([email protected]) wrote:

I'm not sure of a tool - although I would imagine there is one.  You could
patch Rake (groans!!!) and log to a file or whatever.

Here's an example I whipped up to do that...

https://gist.github.com/acuppy/7083de1ce2be1db2a0bb324ee3b19f8b

A little insight into the options.  Note: this is only be supported by Ruby
>= 2.0, because of Module#prepend.

I hope it helps :)

- Adam

On Mon, Jul 25, 2016 at 4:54 PM, Chris McCann <[email protected]> wrote:

> I'm wondering if anyone here has tried modifying rake to log all rake
> tasks called on a particular Rails app.
>
> The thought here being that it can be handy when things go awry to see
> exactly what rake tasks were executed against a particular app, and to have
> a log for security purposes.
>
> If you know of something like this please let me know!
>
> Cheers,
>
> Chris
> --
> --
> SD Ruby mailing list
> [email protected]
> http://groups.google.com/group/sdruby
> ---
> You received this message because you are subscribed to the Google Groups
> "SD Ruby" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



--
:: *Adam Cuppy*
:: 866.858.5988 ext. 101
:: 541.660.3681

*>> Need a few minutes to chat? Schedule a time
<http://bit.ly/scheduling-adamcuppy>*
--
--
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
---
You received this message because you are subscribed to the Google Groups
"SD Ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
For more options, visit https://groups.google.com/d/optout.

-- 
-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
--- 
You received this message because you are subscribed to the Google Groups "SD 
Ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to