Add --cron option #43

Closed
wants to merge 5 commits into
from

Projects

None yet

4 participants

@danlucraft
Contributor

This option is like --silent except if there is an error it will print a full backtrace.

The motivation for this option is cronjobs. We get emails about cron tasks if there is any output at all, hence we use --silent to quiet rake down. But if a cronjob has failed (often overnight) you would like the email to contain as much information as possible about the error, so this prints backtraces.

BTW this relies on the previous pull request about tests to make it's tests work.

@jimweirich
Owner

Interesting idea ... I'm considering it. Not wild about the option name, I would rather name it for what it does rather than where it is intended to be used.

@danlucraft
Contributor

Good thinking. I'm finding it hard to come up with better names that aren't verbose. --silent-trace perhaps?

@quix
Contributor
quix commented Jun 6, 2011

I never understood why backtraces were suppressed in the first place. I have performed this ritual many times: swear, add --trace, re-run, wait all over again. In fact I think this was the genesis of Drake.

@richmeyers

Besides cron jobs this will also be useful in rake tasks run during deployment. For example, when doing a fresh deployment, if a rake task fails the remote source tree is destroyed and thus even invoking rake with --trace is not easily possible.

As others said I do not understand why printing backtraces is not default behavior: #31

@jimweirich
Owner

Rake in master now prints a truncated backtrace by default. Is this sufficient for you?

@jimweirich jimweirich closed this Oct 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment