Skip to content

Commit

Permalink
Use slog
Browse files Browse the repository at this point in the history
  • Loading branch information
tellet-q committed Dec 20, 2024
1 parent c2085cb commit f8c306c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions qdrant/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package qdrant

import (
"fmt"
"log"
"log/slog"
"os/exec"
"strings"

Expand Down Expand Up @@ -52,14 +52,16 @@ func NewGrpcClient(config *Config) (*GrpcClient, error) {

if !config.SkipCompatibilityCheck {
serverVersion := getServerVersion(newGrpcClientFromConn)
logger := slog.Default()
if serverVersion == unknownVersion {
log.Printf("Failed to obtain server version. " +
logger.Warn("Failed to obtain server version. " +
"Unable to check client-server compatibility. " +
"Set SkipCompatibilityCheck=true to skip version check.")
} else if !IsCompatible(&clientVersion, &serverVersion) {
log.Printf("Qdrant client version `%s` is incompatible with server version `%s`. "+
logger.Warn("Client version is not compatible with server version. "+
"Major versions should match and minor version difference must not exceed 1. "+
"Set SkipCompatibilityCheck=true to skip version check.", clientVersion, serverVersion)
"Set SkipCompatibilityCheck=true to skip version check.",
"clientVersion", clientVersion, "serverVersion", serverVersion)
}
}

Expand Down

0 comments on commit f8c306c

Please sign in to comment.