gcplogging

package module
v0.0.0-...-ebe4dd0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const NoTrace string = ""

Variables

This section is empty.

Functions

func GCPProject

func GCPProject() string

func InitGCPEnvironment

func InitGCPEnvironment(defaultProj string) (string, bool)

Get the GCP project, and if we are running in cloud

func InitLogging

func InitLogging(gcpproject string)

Setup logging, log level

func Log

func Log(payload string, severity Severity)

Log error message

func LogTrace

func LogTrace(payload string, severity Severity, r *http.Request)

Log error message with trace from http request

func RunningInGCP

func RunningInGCP() bool

Returns if we are running in GCP cloud.

func ShouldLog

func ShouldLog(severity Severity) bool

Returns true if the severity should be logged.

func Trace

func Trace(r *http.Request) string

Create Trace string based on google project if we run in a cloud env

Types

type Severity

type Severity int8
const Critical Severity = 4
const Debug Severity = 0
const Error Severity = 3
const Info Severity = 1
const Warning Severity = 2

func (Severity) String

func (s Severity) String() string

Jump to

Keyboard shortcuts

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