log

package
v0.0.0-...-589166d Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 15 Imported by: 35

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// matches URLs that look like /subscriptions/%s/providers/%s/%s
	RXProviderResourceKind = regexp.MustCompile(`^/subscriptions/([^/]+)/providers/([^/]+)/([^/]+)$`)

	// matches URLs that look like /admin/providers/%s/%s
	RXAdminProvider = regexp.MustCompile(`^/admin/providers/([^/]+)/([^/]+)$`)

	RXTolerantResourceID = regexp.MustCompile(`(?i)^(?:/admin)?/subscriptions/([^/]+)(?:/resourceGroups/([^/]+)(?:/providers/([^/]+)/([^/]+)(?:/([^/]+))?)?)?`)

	RXTolerantSubResourceID = regexp.MustCompile(`(?i)^(?:/admin)?/subscriptions/([^/]+)(?:/resourceGroups/([^/]+)(?:/providers/([^/]+)/([^/]+)/([^/]+)(?:/([^/]+))?)?)?`)
)

Functions

func EnrichHiveWithCorrelationData

func EnrichHiveWithCorrelationData(cd *hivev1.ClusterDeployment, correlationData *api.CorrelationData) error

EnrichHiveWithCorrelationData sets correlation log fields based on correlationData struct.

func EnrichHiveWithResourceID

func EnrichHiveWithResourceID(cd *hivev1.ClusterDeployment, resourceID string) error

EnrichHiveWithResourceID sets resource log fields based on a cluster resourceID.

func EnrichWithClusterDeploymentNamespace

func EnrichWithClusterDeploymentNamespace(log *logrus.Entry, clusterDeploymentNamespace string) *logrus.Entry

EnrichWithClusterDeploymentNamespace sets log fields based on hiveProfile.Namespace

func EnrichWithClusterVersion

func EnrichWithClusterVersion(log *logrus.Entry, version string) *logrus.Entry

EnrichWithClusterVersion set log fields based on cluster version

func EnrichWithCorrelationData

func EnrichWithCorrelationData(log *logrus.Entry, correlationData *api.CorrelationData) *logrus.Entry

EnrichWithCorrelationData sets log fields based on an optional correlationData struct

func EnrichWithPath

func EnrichWithPath(log *logrus.Entry, path string) *logrus.Entry

EnrichWithPath parses the URL path for part or all of an Azure resource ID and sets log fields accordingly

func EnrichWithResourceID

func EnrichWithResourceID(log *logrus.Entry, resourceID string) *logrus.Entry

EnrichWithResourceID sets log fields based on a resource ID

func GetAuditEntry

func GetAuditEntry() *logrus.Entry

GetAuditEntry returns a consistently configured audit log entry

func GetLogger

func GetLogger() *logrus.Entry

GetLogger returns a consistently configured log entry

func LogrWrapper

func LogrWrapper(logger *logrus.Entry) logr.Logger

func ResetHiveCorrelationData

func ResetHiveCorrelationData(cd *hivev1.ClusterDeployment) error

ResetHiveCorrelationData removes correlation log fields from ClusterDeployment, if present.

Types

type ResultType

type ResultType string
const (
	SuccessResultType     ResultType = "Success"
	UserErrorResultType   ResultType = "UserError"
	ServerErrorResultType ResultType = "InternalServerError"
)

func MapStatusCodeToResultType

func MapStatusCodeToResultType(statusCode int) ResultType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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