-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add logging verbosity level flag to extract_ir.py #278
Add logging verbosity level flag to extract_ir.py #278
Conversation
https://abseil.io/docs/python/guides/logging? has already a command line for verbosity (should be |
adaa73d
to
2e8454e
Compare
Updated to use the absl logging facilities rather than custom plumbing everywhere. |
This commit adds a logging verbosity level flag to extract_ir.py and the appropriate plumbing/implementation in extract_ir_lib.py. This is primarily motivated by these errors coming up quite often in non-trivial builds (as it is fairly often there is some assembly or some flags don't get passed around somewhere) and not providing a very high signal to noise ratio, especially when used as a library against a bunch of projects at once.
2e8454e
to
c7e2903
Compare
- Don't change logging verbosity back to info to print the status message if the verbosity has been set lower.
- Log subprocess output directly rather than having subprocess write directly to STDOUT/STDERR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some nits
- Switch to using subprocess.check_output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't forget to change the commit message
This commit adds a logging verbosity level flag to extract_ir.py and the appropriate plumbing/implementation in extract_ir_lib.py. This is primarily motivated by these errors coming up quite often in non-trivial builds (as it is fairly often there is some assembly or some flags don't get passed around somewhere) and not providing a very high signal to noise ratio, especially when used as a library against a bunch of projects at once.
I've implemented this as a custom flag rather than using absl's
logging.get_verbosity
andlogging.set_verbosity
as I think this approach is a bit more expressive for the purposes here, and it also avoids us needing to set global state which is nice within the project and especially for downstream users (although it's not a big switch to do so the other method). I'm open to switching over if others have different ideas.