Documentation
¶
Overview ¶
This is an internal helper package to combine the complete logging APIs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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.
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 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 *tscore.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" )