cloudfunctions

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEntry

type LogEntry struct {
	Message  string `json:"message"`
	Severity string `json:"severity,omitempty"`
	// Trace will be the same for one function call, you can use it for filetering in logs
	Trace  string            `json:"logging.googleapis.com/trace,omitempty"`
	Labels map[string]string `json:"logging.googleapis.com/operation,omitempty"`
	// Cloud Log Viewer allows filtering and display of this as `jsonPayload.component`.
	Component string `json:"component,omitempty"`
}

Entry defines a log entry.

func NewLogger

func NewLogger() *LogEntry

func (*LogEntry) GenerateTraceValue

func (e *LogEntry) GenerateTraceValue(projectID, traceFunctionName string) *LogEntry

func (LogEntry) LogCritical

func (e LogEntry) LogCritical(message string)

func (LogEntry) LogError

func (e LogEntry) LogError(message string)

func (LogEntry) LogInfo

func (e LogEntry) LogInfo(message string)

func (LogEntry) String

func (e LogEntry) String() string

String renders an entry structure to the JSON format expected by Cloud Logging.

func (*LogEntry) WithComponent

func (e *LogEntry) WithComponent(component string) *LogEntry

func (*LogEntry) WithLabel

func (e *LogEntry) WithLabel(key, value string) *LogEntry

func (*LogEntry) WithTrace

func (e *LogEntry) WithTrace(trace string) *LogEntry

Jump to

Keyboard shortcuts

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