package internal
import "cloud.google.com/go/logging/internal"
Index ¶
- Constants
- func DeconstructXCloudTraceContext(s string) (traceID, spanID string, traceSampled bool)
- func FixUTF8(s string) string
- func LogIDFromPath(parent, path string) string
- func LogPath(parent, logID string) string
- func ToProtoStruct(v interface{}) (*structpb.Struct, error)
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 ¶
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:
- traceID (optional): "105445aa7843bc8bf206b120001000"
- spanID (optional): "1"
- traceSampled (optional): true
func FixUTF8 ¶
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 ¶
LogIDFromPath parses and returns the ID from a log path.
func LogPath ¶
LogPath creates a formatted path from a parent and a logID.
func ToProtoStruct ¶
ToProtoStruct converts v, which must marshal into a JSON object, into a Google Struct proto.
Source Files ¶
common.go
Directories ¶
Path | Synopsis |
---|---|
internal/testing | Package 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.