jimweirich/rake — Issue #83: Hard to debug traces
Author: zimbatm
Created: 2011-10-26 10:25:28+00:00
State: open

Taking the example of issue #82.

```
rake -t
** Invoke default (first_time)
** Invoke file1 (first_time, not_needed)
** Invoke foo (first_time)
** Invoke file2 (first_time, not_needed)
** Execute foo
foo
** Execute default
```

Why was foo executed ? What kind of task is it ? It's not possible to tell just by inspecting the trace log.

Therefore, I propose to change the signature of the "Task#needed?" method returns a reason or nil instead of a boolean, to be re-used in the trace logs, and to also show the task type in the trace logs.

The "what kind of task is it" part is especially important because a task type is determined by it's first declaration. Even with namespaces, I had the case where a task would have two definitions and change behavior depending on the "rakelib/*.rake" inclusion order (which should have raised a conflict error, but this is another issue).