Documentation
¶
Overview ¶
Package log provides a slog.Handler integrated with Cloud Logging.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Logger ¶
Logger returns a slog.Logger which integrates with Cloud Logging and Cloud Error Reporting.
Types ¶
type Option ¶
type Option func(*options)
Option configures the GCP runtime with specific options.
func WithOption ¶
WithOption provides the gcp.Option(s) to configure the logger.
func WithProject ¶
WithProject provides the GCP project ID.
By default, it uses the project ID from the metadata server if it's running on GCP.
func WithService ¶
WithService provides the GCP service name.
By default, it reads from environment variable "K_SERVICE" if it's running on Google Cloud Run.
func WithVersion ¶
WithVersion provides the GCP service version.
By default, it reads from environment variable "K_REVISION" if it's running on Google Cloud Run.