File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
packages/google-cloud-logging/google/cloud/logging_v2 Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -355,13 +355,9 @@ def get_default_handler(self, **kw):
355355 return AppEngineHandler (self , ** kw )
356356 elif monitored_resource .type == _GKE_RESOURCE_TYPE :
357357 return ContainerEngineHandler (** kw )
358- elif (
359- monitored_resource .type == _GCF_RESOURCE_TYPE
360- and sys .version_info [0 ] == 3
361- and sys .version_info [1 ] >= 8
362- ):
363- # Cloud Functions with runtimes > 3.8 supports structured logs on standard out
364- # 3.7 should use the standard CloudLoggingHandler, which sends logs over the network.
358+ elif monitored_resource .type == _GCF_RESOURCE_TYPE :
359+ # __stdout__ stream required to support structured logging on Python 3.7
360+ kw ["stream" ] = kw .get ("stream" , sys .__stdout__ )
365361 return StructuredLogHandler (** kw , project_id = self .project )
366362 elif monitored_resource .type == _RUN_RESOURCE_TYPE :
367363 return StructuredLogHandler (** kw , project_id = self .project )
Original file line number Diff line number Diff line change 1- Subproject commit 17b7a46908320891605908d5baa5f32eb255380e
1+ Subproject commit dc85066053b8dc2246c8b72f93a5b97f92885eb2
You can’t perform that action at this time.
0 commit comments