leiningen
leiningen copied to clipboard
Verbose option
What if we could provide some sort of verbose option that allowed users to see every task and alias invocation, along with the profiles active at the time?
:+1:
Is it reasonable to consider this as an improvement over the DEBUG env. var, or is this orthogonal to it?
I think it would be good to add this to DEBUG.
Realizing now that my ideal scenario is probably really hard or impossible, in the face of tasks (potentially from arbitrary plugins) delegating to each other, but for the common case I'm thinking of (some alias expands to lein do clean, foo, bar, baz stuff, qux, deploy
), it'd be cool to see when each step is happening.
I'd personally love to be able to turn this on for normal use, not purely for debugging, though it'd definitely be useful for that too. But I do get that we also can't turn it on by default (e.g. someone running lein classpath
would be annoyed at extra output).
I don't think this is infeasible. Any higher-order task that calls another task (not hard-coded things like uberjar calling jar) would go through leiningen.core.main/apply-task. If you added debug logging there, you may get what you want.
Yeah the hard-coded stuff was the tricky bit I was thinking of.
The hard-coded stuff isn't as bad as you'd think. The tricky bits of the jar creation are usually the invocation of :prep-tasks, which goes through l.c.m/apply-task.
Sorry, to clarify: I think I'm imagining worse stuff, like where a plugin author creates leiningen.foo/foo
which calls leiningen.foo-bar/foo-bar
which call leiningen.foo-baz/foo-baz
. In that case I was thinking we'd need the plugin author to do something to let us know at the start of their task run. Hmm, although I guess we have a list of tasks for lein help
so it might be feasible to robert-hooke our way out of that.
I think the best thing to do would be to encourage plugin authors to use apply-task where relevant in the documentation and add tracing in there. I would rather not add any hooks usage to Leiningen itself, though a plugin could do it.
It's not relevant, I think we need the jump points DEBUG info from lein and can not depend on plugin authors do it or may not do it.
Is someone doing that?