logger

package
v1.6.24 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: MIT Imports: 10 Imported by: 9

Documentation

Overview

Copyright Microsoft. All rights reserved.

Copyright Microsoft. All rights reserved.

Index

Constants

View Source
const (
	// Metrics
	HeartBeatMetricStr       = "HeartBeat"
	ConfigSnapshotMetricsStr = "ConfigSnapshot"

	HomeAZStr                       = "HomeAZ"
	IsAZRSupportedStr               = "IsAZRSupported"
	IsAZRDualStackFixPresentStr     = "IsAZRDualStackFixPresent"
	HomeAZErrorCodeStr              = "HomeAZErrorCode"
	HomeAZErrorMsgStr               = "HomeAZErrorMsg"
	CNSConfigPropertyStr            = "CNSConfiguration"
	CNSConfigMD5CheckSumPropertyStr = "CNSConfigurationMD5Checksum"

	// CNS NC Snspshot properties
	CnsNCSnapshotEventStr         = "CNSNCSnapshot"
	IpConfigurationStr            = "IPConfiguration"
	LocalIPConfigurationStr       = "LocalIPConfiguration"
	PrimaryInterfaceIdentifierStr = "PrimaryInterfaceIdentifier"
	MultiTenancyInfoStr           = "MultiTenancyInfo"
	CnetAddressSpaceStr           = "CnetAddressSpace"
	AllowNCToHostCommunicationStr = "AllowNCToHostCommunication"
	AllowHostToNCCommunicationStr = "AllowHostToNCCommunication"
	NetworkContainerTypeStr       = "NetworkContainerType"
	OrchestratorContextStr        = "OrchestratorContext"
)

Variables

This section is empty.

Functions

func Close

func Close()

func Debugf

func Debugf(format string, args ...any)

func Errorf

func Errorf(format string, args ...any)

func InitAI

func InitAI(aiConfig aitelemetry.AIConfig, disableTraceLogging, disableMetricLogging, disableEventLogging bool)

func InitAIWithIKey

func InitAIWithIKey(aiConfig aitelemetry.AIConfig, instrumentationKey string, disableTraceLogging, disableMetricLogging, disableEventLogging bool)

func InitLogger

func InitLogger(fileName string, logLevel, logTarget int, logDir string)

func LogEvent

func LogEvent(event aitelemetry.Event)

func Printf

func Printf(format string, args ...any)

func Request

func Request(tag string, request any, err error)

func Response

func Response(tag string, response any, returnCode types.ResponseCode, err error)

func ResponseEx

func ResponseEx(tag string, request, response any, returnCode types.ResponseCode, err error)

func SendMetric

func SendMetric(metric aitelemetry.Metric)

func SetContextDetails

func SetContextDetails(orchestrator, nodeID string)

func Warnf

func Warnf(format string, args ...any)

Types

type CNSLogger

type CNSLogger struct {
	// contains filtered or unexported fields
}
var (
	Log *CNSLogger

	AppInsightsIKey = aiMetadata
)

func New added in v1.6.22

func New(fileName string, logLevel, logTarget int, logDir string) (*CNSLogger, error)

func (*CNSLogger) Close

func (c *CNSLogger) Close()

func (*CNSLogger) Debugf

func (c *CNSLogger) Debugf(format string, args ...any)

func (*CNSLogger) Errorf

func (c *CNSLogger) Errorf(format string, args ...any)

func (*CNSLogger) InitAI

func (c *CNSLogger) InitAI(aiConfig ai.AIConfig, disableTraceLogging, disableMetricLogging, disableEventLogging bool)

func (*CNSLogger) InitAIWithIKey

func (c *CNSLogger) InitAIWithIKey(aiConfig ai.AIConfig, instrumentationKey string, disableTraceLogging, disableMetricLogging, disableEventLogging bool)

func (*CNSLogger) LogEvent

func (c *CNSLogger) LogEvent(event ai.Event)

func (*CNSLogger) Printf

func (c *CNSLogger) Printf(format string, args ...any)

func (*CNSLogger) Request

func (c *CNSLogger) Request(tag string, request any, err error)

func (*CNSLogger) Response

func (c *CNSLogger) Response(tag string, response any, returnCode types.ResponseCode, err error)

func (*CNSLogger) ResponseEx

func (c *CNSLogger) ResponseEx(tag string, request, response any, returnCode types.ResponseCode, err error)

func (*CNSLogger) SendMetric

func (c *CNSLogger) SendMetric(metric ai.Metric)

func (*CNSLogger) SetAPIServer added in v1.6.22

func (c *CNSLogger) SetAPIServer(apiserver string)

func (*CNSLogger) SetContextDetails

func (c *CNSLogger) SetContextDetails(orchestrator, nodeID string)

func (*CNSLogger) Warnf

func (c *CNSLogger) Warnf(format string, args ...any)

Directories

Path Synopsis
v2

Jump to

Keyboard shortcuts

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