package log

import "github.com/Azure/azure-sdk-for-go/sdk/azcore/log"

Package log contains functionality for configuring logging behavior. Default logging to stderr can be enabled by setting environment variable AZURE_SDK_GO_LOGGING to "all".

Package log provides functionality for configuring logging facilities.

Index

Functions

func SetEvents

func SetEvents(cls ...Event)

SetEvents is used to control which events are written to the log. By default all log events are writen. NOTE: this is not goroutine safe and should be called before using SDK clients.

func SetListener

func SetListener(lst func(Event, string))

SetListener will set the Logger to write to the specified Listener. NOTE: this is not goroutine safe and should be called before using SDK clients.

Types

type Event

type Event = log.Event

Event is used to group entries. Each group can be toggled on or off.

const (
	// EventRequest entries contain information about HTTP requests.
	// This includes information like the URL, query parameters, and headers.
	EventRequest Event = "Request"

	// EventResponse entries contain information about HTTP responses.
	// This includes information like the HTTP status code, headers, and request URL.
	EventResponse Event = "Response"

	// EventResponseError entries contain information about HTTP responses that returned
	// an *azcore.ResponseError (i.e. responses with a non 2xx HTTP status code).
	// This includes the contents of ResponseError.Error().
	EventResponseError Event = "ResponseError"

	// EventRetryPolicy entries contain information specific to the retry policy in use.
	EventRetryPolicy Event = "Retry"

	// EventLRO entries contain information specific to long-running operations.
	// This includes information like polling location, operation state, and sleep intervals.
	EventLRO Event = "LongRunningOperation"
)

Source Files

doc.go log.go

Version
v1.18.0 (latest)
Published
Apr 3, 2025
Platform
windows/amd64
Imports
1 packages
Last checked
4 hours ago

Tools for package owners.