Skip to content

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

@timdonovanuk

Description

@timdonovanuk

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.

Metadata

Metadata

Assignees

Labels

type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions