-
-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to print action before executing it. #390
Comments
If it is just for debugging you can easily:
I dont think messing with
I guess this would be a good default, but it should be possible to overwrite it (implemented as class method). TODO:
|
This would be very useful for debugging tasks that you've not created yourself but inherited from another package. |
@maximlt there is PR open for that. I cant remember which state was it... does that work for you? |
Sorry @schettino72 I've got really low bandwidth these days, hopefully some time later! Thanks for your prompt answer anyway. |
I would find this useful also. 👍 |
Feel free to pick up the partial PR #392. Sorry to say I won't be able to finish the PR myself. |
Feature request: ability to print some data about each action before it gets executed.
Motivation:
If my task has multiple actions (and verbosity==2), I can't tell which output came from which action (assuming that the actions all succeed). Some way to tell which output comes from which action would be great. Printing e.g. the shell command that will be run, before running it, would be a good way to achieve this.
If you write
echo 123
as part of a recipe in a Makefile (using GNU make), the following is printed:+ echo 123 123
This is great for debugging purposes, so that you will know what command has produced the output you are seeing. The
+
symbol prefix makes it easy to tell what is the command, and what is the output from the command.Possible API design:
Perhaps this could be verbosity level 3?
For
CmdAction
, it should be easy to print the action that will be executed byPopen
, just before it gets executed.For
PythonAction
, it is not as clear what should be the output. Perhaps astr
representation of the python-action and it's args and kwargs...Describe alternatives you've considered
I have tried using the
title
keyword for the task, with a custom title printer:However, when I run
doit --verbosity 2
on thisdodo.py
file, the results are out of order:I still cannot tell where the stdout from the first action ("abc efg") end, and the stdout from the second action ("in py_action: a=2, b=4") begins. This is why I'm requesting this feature.
The text was updated successfully, but these errors were encountered: