package log

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

This is an internal helper package to combine the complete logging APIs.

Index

Constants

const (
	EventRequest       = azlog.EventRequest
	EventResponse      = azlog.EventResponse
	EventResponseError = azlog.EventResponseError
	EventRetryPolicy   = azlog.EventRetryPolicy
	EventLRO           = azlog.EventLRO
)

Functions

func SetListener

func SetListener(lst func(Event, string))

SetListener will set the Logger to write to the specified listener.

func Should

func Should(cls log.Event) bool

Should returns true if the specified log event should be written to the log. By default all log events will be logged. Call SetEvents() to limit the log events for logging. If no listener has been set this will return false. Calling this method is useful when the message to log is computationally expensive and you want to avoid the overhead if its log event is not enabled.

func Write

func Write(cls log.Event, msg string)

Write invokes the underlying listener with the specified event and message. If the event shouldn't be logged or there is no listener then Write does nothing.

func Writef

func Writef(cls log.Event, format string, a ...any)

Writef invokes the underlying listener with the specified event and formatted message. If the event shouldn't be logged or there is no listener then Writef does nothing.

Types

type Event

type Event = log.Event

Source Files

log.go

Version
v1.18.0 (latest)
Published
Apr 3, 2025
Platform
js/wasm
Imports
2 packages
Last checked
2 hours ago

Tools for package owners.