Skip to content
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

Reduce log spam by discovery.py by lowering logger level from info to debug/warn #781

Closed
timdonovanuk opened this issue Nov 11, 2019 · 3 comments
Assignees

Comments

@timdonovanuk
Copy link

@timdonovanuk timdonovanuk commented Nov 11, 2019

This line in discovery.py:

logger.info("URL being requested: GET %s", actual_url)

creates a lot of unncessary log spam. I don't think we need to know every time this code makes a request to Google, unless you're debugging. I use this library as part of HomeAssistant and my logs end up looking like (URLs sanitised):

2019-11-11 09:44:02 INFO (SyncWorker_6) [googleapiclient.discovery] URL being requested: GET https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest
2019-11-11 09:44:02 INFO (SyncWorker_6) [googleapiclient.discovery] URL being requested: GET https://www.googleapis.com/calendar/v3/calendars/
2019-11-11 09:44:02 INFO (SyncWorker_2) [googleapiclient.discovery] URL being requested: GET https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest
2019-11-11 09:44:02 INFO (SyncWorker_2) [googleapiclient.discovery] URL being requested: GET https://www.googleapis.com/calendar/v3/calendars/
2019-11-11 09:44:03 INFO (SyncWorker_9) [googleapiclient.discovery] URL being requested: GET https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest
2019-11-11 09:44:03 INFO (SyncWorker_9) [googleapiclient.discovery] URL being requested: GET https://www.googleapis.com/calendar/v3/calendars/
2019-11-11 09:44:03 INFO (SyncWorker_6) [googleapiclient.discovery] URL being requested: GET https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest
2019-11-11 09:44:03 INFO (SyncWorker_6) [googleapiclient.discovery] URL being requested: GET https://www.googleapis.com/calendar/v3/calendars/
2019-11-11 09:44:03 INFO (SyncWorker_6) [googleapiclient.discovery] URL being requested: GET https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest
2019-11-11 09:44:04 INFO (SyncWorker_6) [googleapiclient.discovery] URL being requested: GET https://www.googleapis.com/calendar/v3/calendars/
2019-11-11 09:44:04 INFO (SyncWorker_3) [googleapiclient.discovery] URL being requested: GET https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest
2019-11-11 09:44:04 INFO (SyncWorker_3) [googleapiclient.discovery] URL being requested: GET https://www.googleapis.com/calendar/v3/calendars/

Wouldn't logger.debug be more appropratie?

Thanks.

@timdonovanuk timdonovanuk changed the title Reduce log spam in discovery.py by Lower logger level in to something else Reduce log spam in discovery.py by lowering logger level from info to debug/warn Nov 11, 2019
@timdonovanuk timdonovanuk changed the title Reduce log spam in discovery.py by lowering logger level from info to debug/warn Reduce log spam by discovery.py by lowering logger level from info to debug/warn Nov 11, 2019
@busunkim96
Copy link
Contributor

@busunkim96 busunkim96 commented Nov 11, 2019

@timdonovanuk Feel free to send a PR if this is of interest!

@timdonovanuk
Copy link
Author

@timdonovanuk timdonovanuk commented Dec 4, 2019

Thanks for this ..I'm not a developer more just get by hacking a bit of code occasionally so didn't know the correct way to submit PRs to this repo :)

busunkim96 added a commit to busunkim96/google-api-python-client that referenced this issue Apr 24, 2020
The current INFO calls, which are highly repetitive, don't meet
the typical 'severity level' of an INFO message, and are more suited
for DEBUG.

Refs Issue googleapis#781
busunkim96 added a commit that referenced this issue Apr 28, 2020
The current INFO calls, which are highly repetitive, don't meet
the typical 'severity level' of an INFO message, and are more suited
for DEBUG.

Refs Issue #781

Authored-by: Brad Solomon <solomonbj@america.gov>
@parthea
Copy link
Contributor

@parthea parthea commented Dec 8, 2020

Hi @ timdonovanuk,

I'm going to close this issue as the issue was solved with PR #885.

@parthea parthea closed this Dec 8, 2020
@parthea parthea self-assigned this Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants