-
Notifications
You must be signed in to change notification settings - Fork 24
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
Use logging instead of printing #58
Comments
I think this is a great idea! No objections from me. Is there any chance you'd be willing to work this in to a pull request that we could review and merge? |
FWIW, there is actually a verbosity parameter included in the query methods. e.g.: scraper/scraper/github/queryManager.py Line 146 in 471e06d
scraper/scraper/github/queryManager.py Lines 161 to 165 in 471e06d
|
I think a PR with these updates would be nice. I’ve gotten around needing this by just piping the output from the process to whatever log file I like, and using the verbosity param that LRWeber points out. |
Setting verbosity to -1 still can't control the print statements: $ cci cfa --terminal https://github.com/vsoch/salad
Generating CFA for https://github.com/vsoch/salad
Stored new data file path '/home/vanessa/Desktop/Code/contributor-ci/.cci/data/latest/cci-repos.json'
Importing existing data file '/home/vanessa/Desktop/Code/contributor-ci/.cci/data/latest/cci-repos.json' ... Imported!
Retrieving repository info for vsoch/salad
Checking GitHub API token... Token validated.
Auto-retry limit for requests set to 10.
# nothing above this line should be printed!
---
repository: vsoch/salad
title: vsoch/salad
--- |
Would y'all be okay with removing these custom print functions in favor of standard python logging? It looks like you use it in other parts of the library but they didn't make it here! Do you remember if there was a special reason to do this? |
The primary reason for using the basic print rather than logging was to enable some of the more human-friendly feedback for when the commands are run directly in real-time, for example the visible countdown when waiting to retry a query (especially when the GitHub API limit triggers a much longer wait time). In short, this update will mean more extensive re-working of how some of the info is presented. However, if we believe the tradeoff is worthwhile, I'm sure we can come up with a similarly informative logging friendly version. |
Heyo! I'm wondering if instead of having a bunch of print statements (that the user cannot control)
It would be possible and make sense to using logging instead, so it can be made quiet? For my user case, I have a command that hits a few API endpoints and then needs to pipe to file, and I'm not able to control this output.
The text was updated successfully, but these errors were encountered: