Golang mongo driver uses an interface LogSink
which has the following structure:
type LogSink interface {
// Info logs a non-error message with the given key/value pairs. The
// level argument is provided for optional logging.
Info(level int, msg string, keysAndValues ...interface{})
// Error logs an error, with the given message and key/value pairs.
Error(err error, msg string, keysAndValues ...interface{})
}
This interface does not tells anything about context.Context
. How can we transfer some information to the logger as there is no context involved ? My use case: I want to send query logs to some external service along with some user information that will be available in http or grpc request.