Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
gkevinzheng committed Jun 24, 2024
1 parent 5ae6161 commit 9f4bfe8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions google/cloud/logging_v2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,18 +380,21 @@ def get_default_handler(self, **kw):
_GAE_RESOURCE_TYPE,
_GKE_RESOURCE_TYPE,
_GCF_RESOURCE_TYPE,
_RUN_RESOURCE_TYPE
_RUN_RESOURCE_TYPE,
]

if isinstance(monitored_resource, Resource) and monitored_resource.type in _structured_log_types:
if (
isinstance(monitored_resource, Resource)
and monitored_resource.type in _structured_log_types
):
if monitored_resource.type == _GCF_RESOURCE_TYPE:
# __stdout__ stream required to support structured logging on Python 3.7
kw["stream"] = kw.get("stream", sys.__stdout__)

handler = StructuredLogHandler(**kw, project_id=self.project)
else:
handler = CloudLoggingHandler(self, resource=monitored_resource, **kw)

return handler

def setup_logging(
Expand Down

0 comments on commit 9f4bfe8

Please sign in to comment.