package log
import "github.com/Azure/azure-sdk-for-go/sdk/internal/log"
Index ¶
- func SetEvents(cls ...Event)
- func SetListener(lst func(Event, string))
- func Should(cls Event) bool
- func TestResetEvents()
- func Write(cls Event, message string)
- func Writef(cls Event, format string, a ...interface{})
- type Event
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.
func SetListener ¶
SetListener will set the Logger to write to the specified listener.
func Should ¶
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 TestResetEvents ¶
func TestResetEvents()
TestResetEvents is used for testing purposes only.
func Write ¶
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 ¶
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 string
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 containe information about HTTP responses. // This includes information like the HTTP status code, headers, and request URL. EventResponse Event = "Response" // EventRetryPolicy entries contain information specific to the rety policy in use. EventRetryPolicy Event = "Retry" // EventLRO entries contian information specific to long-running operations. // This includes information like polling location, operation state, and sleep intervals. EventLRO Event = "LongRunningOperation" )
Source Files ¶
- Version
- v0.8.2
- Published
- Nov 11, 2021
- Platform
- darwin/amd64
- Imports
- 3 packages
- Last checked
- 6 hours ago –
Tools for package owners.