Versions in this module Expand all Collapse all v1 v1.16.1 Sep 18, 2024 Changes in this version + const CommandFailed + const CommandStarted + const CommandSucceeded + const ConnectionCheckedIn + const ConnectionCheckedOut + const ConnectionCheckoutFailed + const ConnectionCheckoutStarted + const ConnectionClosed + const ConnectionCreated + const ConnectionPoolCleared + const ConnectionPoolClosed + const ConnectionPoolCreated + const ConnectionPoolReady + const ConnectionReady + const DefaultMaxDocumentLength + const DiffToInfo + const KeyAwaited + const KeyCommand + const KeyCommandName + const KeyDatabaseName + const KeyDriverConnectionID + const KeyDurationMS + const KeyError + const KeyFailure + const KeyMaxConnecting + const KeyMaxIdleTimeMS + const KeyMaxPoolSize + const KeyMessage + const KeyMinPoolSize + const KeyNewDescription + const KeyOperation + const KeyOperationID + const KeyPreviousDescription + const KeyReason + const KeyRemainingTimeMS + const KeyReply + const KeyRequestID + const KeySelector + const KeyServerConnectionID + const KeyServerHost + const KeyServerPort + const KeyServiceID + const KeyTimestamp + const KeyTopologyDescription + const KeyTopologyID + const ReasonConnCheckoutFailedError + const ReasonConnCheckoutFailedPoolClosed + const ReasonConnCheckoutFailedTimout + const ReasonConnClosedError + const ReasonConnClosedIdle + const ReasonConnClosedPoolClosed + const ReasonConnClosedStale + const ServerSelectionFailed + const ServerSelectionStarted + const ServerSelectionSucceeded + const ServerSelectionWaiting + const TopologyClosed + const TopologyDescriptionChanged + const TopologyOpening + const TopologyServerClosed + const TopologyServerHeartbeatFailed + const TopologyServerHeartbeatStarted + const TopologyServerHeartbeatSucceeded + const TopologyServerOpening + const TruncationSuffix + var LevelLiteralMap = map[string]Level + func EnvHasComponentVariables() bool + func FormatMessage(msg string, width uint) string + func OperationID(ctx context.Context) (int32, bool) + func OperationName(ctx context.Context) (string, bool) + func WithOperationID(ctx context.Context, operationID int32) context.Context + func WithOperationName(ctx context.Context, operation string) context.Context + type Command struct + DatabaseName string + DriverConnectionID uint64 + Message string + Name string + OperationID int32 + RequestID int64 + ServerConnectionID *int64 + ServerHost string + ServerPort string + ServiceID *primitive.ObjectID + type Component int + const ComponentAll + const ComponentCommand + const ComponentConnection + const ComponentServerSelection + const ComponentTopology + type Connection struct + Message string + ServerHost string + ServerPort string + type IOSink struct + func NewIOSink(out io.Writer) *IOSink + func (sink *IOSink) Error(err error, msg string, kv ...interface{}) + func (sink *IOSink) Info(_ int, msg string, keysAndValues ...interface{}) + type KeyValues []interface + func (kvs *KeyValues) Add(key string, value interface{}) + func SerializeCommand(cmd Command, extraKeysAndValues ...interface{}) KeyValues + func SerializeConnection(conn Connection, extraKeysAndValues ...interface{}) KeyValues + func SerializeServer(srv Server, extraKV ...interface{}) KeyValues + func SerializeServerSelection(srvSelection ServerSelection, extraKV ...interface{}) KeyValues + func SerializeTopology(topo Topology, extraKV ...interface{}) KeyValues + type Level int + const LevelDebug + const LevelInfo + const LevelOff + func ParseLevel(str string) Level + type LogSink interface + Error func(err error, msg string, keysAndValues ...interface{}) + Info func(level int, msg string, keysAndValues ...interface{}) + type Logger struct + ComponentLevels map[Component]Level + MaxDocumentLength uint + Sink LogSink + func New(sink LogSink, maxDocLen uint, compLevels map[Component]Level) (*Logger, error) + func (logger *Logger) Close() error + func (logger *Logger) Error(err error, msg string, keysAndValues ...interface{}) + func (logger *Logger) LevelComponentEnabled(level Level, component Component) bool + func (logger *Logger) Print(level Level, component Component, msg string, keysAndValues ...interface{}) + type Server struct + DriverConnectionID uint64 + Message string + ServerConnectionID *int64 + ServerHost string + ServerPort string + TopologyID primitive.ObjectID + type ServerSelection struct + Operation string + OperationID *int32 + Selector string + TopologyDescription string + type Topology struct + ID primitive.ObjectID + Message string