Documentation ¶
Index ¶
Constants ¶
View Source
const (
// LoggerNameKey is a key we can use to denote logger names across implementations.
LoggerNameKey = "_name_"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { Info(string) Debug(string) Error(err error, whatWasHappeningWhenErrorOccurred string) SetRequestIDFunc(RequestIDFunc) Clone() Logger WithName(string) Logger WithValues(map[string]any) Logger WithValue(string, any) Logger WithRequest(*http.Request) Logger WithResponse(response *http.Response) Logger WithError(error) Logger WithSpan(span trace.Span) Logger }
Logger represents a simple logging interface we can build wrappers around. NOTICE: someone, naive and green, may be enticed to add a method to this interface akin to: WithQueryFilter(*types.QueryFilter) Logger This is a fool's errand, it would introduce a disallowed import cycle.
func EnsureLogger ¶
EnsureLogger guarantees that a Logger is available.
func NewNoopLogger ¶
func NewNoopLogger() Logger
NewNoopLogger provides our noop Logger to dependency managers.
type RequestIDFunc ¶
RequestIDFunc fetches a string ID from a request.
Click to show internal directories.
Click to hide internal directories.