package internal

import "cloud.google.com/go/logging/internal"

Index

Constants

const (
	// ProdAddr is the production address.
	ProdAddr = "logging.googleapis.com:443"

	// TraceHeader is the HTTP header trace information is stored in.
	TraceHeader = "X-Cloud-Trace-Context"
)

Functions

func DeconstructXCloudTraceContext

func DeconstructXCloudTraceContext(s string) (traceID, spanID string, traceSampled bool)

DeconstructXCloudTraceContext extracts trace information from the trace header.

As per the format described at https://cloud.google.com/trace/docs/setup#force-trace

"X-Cloud-Trace-Context: TRACE_ID/SPAN_ID;o=TRACE_TRUE"

for example:

"X-Cloud-Trace-Context: 105445aa7843bc8bf206b120001000/1;o=1"

We expect:

func FixUTF8

func FixUTF8(s string) string

FixUTF8 is a helper that fixes an invalid UTF-8 string by replacing invalid UTF-8 runes with the Unicode replacement character (U+FFFD). See Issue https://github.com/googleapis/google-cloud-go/issues/1383.

func LogIDFromPath

func LogIDFromPath(parent, path string) string

LogIDFromPath parses and returns the ID from a log path.

func LogPath

func LogPath(parent, logID string) string

LogPath creates a formatted path from a parent and a logID.

func ToProtoStruct

func ToProtoStruct(v interface{}) (*structpb.Struct, error)

ToProtoStruct converts v, which must marshal into a JSON object, into a Google Struct proto.

Source Files

common.go

Directories

PathSynopsis
internal/testingPackage testing provides support for testing the logging client.
Version
v1.5.0-jsonlog-preview
Published
Jun 9, 2021
Platform
js/wasm
Imports
7 packages
Last checked
2 hours ago

Tools for package owners.