logger

package
v1.4.12 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 6 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()

Close CNS and AI telemetry handle

func Debugf

func Debugf(format string, args ...interface{})

func Errorf

func Errorf(format string, args ...interface{})

func InitAI

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

Intialize CNS AI telmetry instance

func InitLogger

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

Initialize CNS Logger

func LogEvent

func LogEvent(event aitelemetry.Event)

func Printf

func Printf(format string, args ...interface{})

also logs in the AI telemetry

func Request

func Request(tag string, request interface{}, err error)

func Response

func Response(tag string, response interface{}, returnCode types.ResponseCode, err error)

func ResponseEx

func ResponseEx(tag string, request interface{}, response interface{}, returnCode types.ResponseCode, err error)

ResponseEx put request and response info together to help easier debug.

func SendHeartBeat

func SendHeartBeat(ctx context.Context, heartbeatIntervalInMins int)

func SendMetric

func SendMetric(metric aitelemetry.Metric)

Send AI telemetry metric

func SetContextDetails

func SetContextDetails(orchestrator string, nodeID string)

Set context details for logs and metrics

func SetTargetLogDirectory added in v1.0.32

func SetTargetLogDirectory(target int, dir string) error

Types

type CNSLogger

type CNSLogger struct {
	Orchestrator         string
	NodeID               string
	DisableTraceLogging  bool
	DisableMetricLogging bool
	DisableEventLogging  bool
	// contains filtered or unexported fields
}
var (
	Log *CNSLogger
)

Jump to

Keyboard shortcuts

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