logger

package
v1.4.28 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 8 Imported by: 9

Documentation

Overview

Copyright Microsoft. All rights reserved.

Copyright Microsoft. All rights reserved.

Index

Constants

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

	// Dimensions
	OrchestratorTypeStr = "OrchestratorType"
	NodeIDStr           = "NodeID"
	// CNS 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 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 SendHeartBeat

func SendHeartBeat(ctx context.Context, heartbeatIntervalInMins int)

func SendMetric

func SendMetric(metric aitelemetry.Metric)

func SetContextDetails

func SetContextDetails(orchestrator, nodeID string)

Types

type CNSLogger

type CNSLogger struct {
	DisableTraceLogging  bool
	DisableMetricLogging bool
	DisableEventLogging  bool

	Orchestrator string
	NodeID       string
	// contains filtered or unexported fields
}
var (
	Log *CNSLogger
)

func NewCNSLogger

func NewCNSLogger(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 aitelemetry.AIConfig, disableTraceLogging, disableMetricLogging, disableEventLogging bool)

func (*CNSLogger) LogEvent

func (c *CNSLogger) LogEvent(event aitelemetry.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 aitelemetry.Metric)

func (*CNSLogger) SetContextDetails

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

Jump to

Keyboard shortcuts

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