cloudtrace

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CloudTraceContextHeader = "X-Cloud-Trace-Context"

The header specification is: "X-Cloud-Trace-Context: TRACE_ID/SPAN_ID;o=TRACE_TRUE"

View Source
const LevelCritical = slog.Level(12)

Extra log level supported by Cloud Logging

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudLoggingHandler

type CloudLoggingHandler struct {
	// contains filtered or unexported fields
}

Handler that outputs JSON understood by the structured log agent. See https://cloud.google.com/logging/docs/agent/logging/configuration#special-fields

func NewCloudLoggingHandler

func NewCloudLoggingHandler(projectID string, level slog.Level) *CloudLoggingHandler

func (*CloudLoggingHandler) Enabled

func (h *CloudLoggingHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*CloudLoggingHandler) Handle

func (h *CloudLoggingHandler) Handle(ctx context.Context, rec slog.Record) error

func (*CloudLoggingHandler) WithAttrs

func (h *CloudLoggingHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*CloudLoggingHandler) WithGroup

func (h *CloudLoggingHandler) WithGroup(name string) slog.Handler

type HTTPHandler

type HTTPHandler struct {
	// Handler to wrap.
	Handler http.Handler
}

func (*HTTPHandler) ServeHTTP

func (h *HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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