Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Add log_struct sample to set severity #741

@ymotongpoo

Description

@ymotongpoo

Is your feature request related to a problem? Please describe.

Current snippets available on the official doc only mentions very primitive use case. However, specifying log level is very common use case and that use case has tricky part (c.f. #739) to handle, so the snippets should touch it.

Describe the solution you'd like

Change log_entry snippet to assign log level explicitly.

Describe alternatives you've considered

Add comments in the document on how to achieve it.

Additional context

Users need to import extra module (google.logging.type.log_severity_pb2) just to specify log level, so the process sounds more complex that the users usually think. (eg. just passing "info" string)

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the googleapis/python-logging API.samplesIssues that are directly related to samples.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions