log

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: MIT Imports: 9 Imported by: 2

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

func Logger(opts ...Option) *slog.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

func WithOption(opts ...gcp.Option) Option

WithOption provides the gcp.Option(s) to configure the logger.

func WithProject

func WithProject(project string) Option

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

func WithService(service string) Option

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

func WithVersion(version string) Option

WithVersion provides the GCP service version.

By default, it reads from environment variable "K_REVISION" if it's running on Google Cloud Run.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL