This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hcoura
Recipients hcoura
Date 2019-12-27.20:33:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1577478792.48.0.935250050519.issue39142@roundup.psfhosted.org>
In-reply-to
Content
While passing

{
    "version": 1,
    "disable_existing_loggers": False,
    "formatters": {
        "verbose": {"format": "%(levelname)s %(asctime)s %(module)s %(message)s"}
    },
    "handlers": {
        "stackdriver": {
            "class": "google.cloud.logging.handlers.CloudLoggingHandler",
            "client": client,
            "resource": resource,
        },
    },
    "root": {"level": "INFO", "handlers": ["stackdriver"]},
}

to logging.config.dictConfig it will convert resource, which is a namedtuple to ConvertingTuple, this will make google.cloud.logging.handlers.CloudLoggingHandler break down the line.

I am having to create a wrapper class like 

class Bla:
    resource = logging.resource.Resource(
        type="cloud_run_revision",
        labels={},
    )

    def _to_dict(self):
        return self.resource._to_dict()

to go around this
History
Date User Action Args
2019-12-27 20:33:12hcourasetrecipients: + hcoura
2019-12-27 20:33:12hcourasetmessageid: <1577478792.48.0.935250050519.issue39142@roundup.psfhosted.org>
2019-12-27 20:33:12hcouralinkissue39142 messages
2019-12-27 20:33:12hcouracreate