It seems that the output is exactly the same with or without --quiet flag.
Might be related to #5
There are only two uses of config['quiet'] in the codebase, both inside manim/extract_scene.py:open_file_if_needed. The body of that function is wrapped in the following:
if config["quiet"]:
curr_stdout = sys.stdout
sys.stdout = open(os.devnull, "w")
...
if config["quiet"]:
sys.stdout.close()
sys.stdout = curr_stdout
So it seems the current purpose of --quiet is to suppress the output of open_file_if_needed (which shows the video, if the -p or --preview flag was also passed), not the output of the scene rendering itself. This is perhaps done because sometimes the software that plays the movie may be very verbose and its output/errors would get mixed in with manim's output.
I think we should change the behavior of --quiet so that it suppresses manim's output as well.
Come to think of it, all we need to do is to have config.py tweak the default logger setup if the --quiet CLI argument has been passed. Tagging @kilacoda who was in charge of the logger/rich PR.
Maybe it would be an option to define different levels of verbosity and have --quiet as a shortcut to --verbosity=0 ?
Yes, good idea. In fact, argparse already allows for automatic detection of things like -v, -vv, -vvv and so on, to indicate levels of verbosity.
Come to think of it, ffmpeg on linux implements the -v loglevel flag. We could mirror that exact same behavior so that manim has similar functionality but also so that we can just pass the -v flag along to ffmpeg as well.
This shouldn't be too hard to implement, any takers?
I can work on that
Great! Is this your first contribution to our repo? If so, please make sure to read the contribution guidelines and let us know if you have any questions!
I kind of is since the last PR I made was for the original project. I'll check the guidelines.
Most helpful comment
I can work on that