You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 by Popen, just before it gets executed.
For PythonAction, it is not as clear what should be the output. Perhaps a str 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:
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.
Activity
schettino72 commentedon Apr 10, 2021
If it is just for debugging you can easily:
titleis for a task, so it wont work for your use-case.I dont think messing with
verbosityit would be a good idea, adding a new parameter would be ok.I guess this would be a good default, but it should be possible to overwrite it (implemented as class method).
TODO:
--show-action(better name suggestions welcome)title()method forPythonAction&CmdActionmaximlt commentedon Jan 27, 2022
This would be very useful for debugging tasks that you've not created yourself but inherited from another package.
schettino72 commentedon Jan 27, 2022
@maximlt there is PR open for that.
I cant remember which state was it... does that work for you?
Did it implement my spec above?
Maybe you can help review it...
maximlt commentedon Jan 28, 2022
Sorry @schettino72 I've got really low bandwidth these days, hopefully some time later! Thanks for your prompt answer anyway.
awesomescot commentedon Dec 27, 2023
I would find this useful also. 👍
Jasha10 commentedon Dec 28, 2023
Feel free to pick up the partial PR #392. Sorry to say I won't be able to finish the PR myself.