google-maps-services-python icon indicating copy to clipboard operation
google-maps-services-python copied to clipboard

Info log output in version 4.7.1

Open vsemionov opened this issue 3 years ago • 5 comments

#455 changed the queries_quota output from print() to logging (see #451). However, since this library is initialized when our Django application is initialized, the same irrelevant output is scattered in multiple places, like management command output, daily maintenance tasks, report emails, etc. Can we please change this to level DEBUG, so it's hidden by default?

vsemionov avatar Dec 07 '22 17:12 vsemionov

Sounds reasonable. Feel free to send a pull request with your desired fix.

wangela avatar Jan 26 '23 16:01 wangela

A pull request has been made, can we also get it reviewed and hopefully a fix released soon?

stianjensen avatar Feb 13 '24 23:02 stianjensen

@wangela Would you able to take a look at the proposed PR with a fix?

stianjensen avatar Apr 02 '24 13:04 stianjensen

In the meantime, fyi, you can also configure the log level for the package in your django application. Setting the handler log level should fix your issue:

LOGGING = {
    "version": 1,
    "disable_existing_loggers": False,
    "handlers": {
        "console": {
            "class": "logging.StreamHandler",
        },
    },
    "google_maps_services_python": {
        ...,
        "level": "WARNING",
    },
}

sondrelg avatar Apr 02 '24 14:04 sondrelg

@sondrelg @wangela That's true, but it would also hide any future messages with an info level, and is not optimal. This issue's pull request is a trivial one-line change and has been open since 2022. I don't understand why it's such a problem to merge it.

vsemionov avatar Apr 02 '24 14:04 vsemionov