From e6ca575e421eb6ea0488c980dbc23ff88744fecc Mon Sep 17 00:00:00 2001 From: wayblink Date: Wed, 11 Oct 2023 17:03:59 +0800 Subject: [PATCH] Refine getbackup log Signed-off-by: wayblink --- core/backup_context.go | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/core/backup_context.go b/core/backup_context.go index ebe18958..41d839e3 100644 --- a/core/backup_context.go +++ b/core/backup_context.go @@ -8,6 +8,7 @@ import ( gomilvus "github.com/milvus-io/milvus-sdk-go/v2/client" "go.uber.org/zap" + "go.uber.org/zap/zapcore" "github.com/zilliztech/milvus-backup/core/paramtable" "github.com/zilliztech/milvus-backup/core/proto/backuppb" @@ -240,13 +241,23 @@ func (b *BackupContext) GetBackup(ctx context.Context, request *backuppb.GetBack resp = SimpleBackupResponse(resp) } - log.Info("finish GetBackupRequest", - zap.String("requestId", request.GetRequestId()), - zap.String("backupName", request.GetBackupName()), - zap.String("backupId", request.GetBackupId()), - zap.String("bucketName", request.GetBucketName()), - zap.String("path", request.GetPath()), - zap.Any("resp", resp)) + if log.GetLevel() == zapcore.DebugLevel { + log.Debug("finish GetBackupRequest", + zap.String("requestId", request.GetRequestId()), + zap.String("backupName", request.GetBackupName()), + zap.String("backupId", request.GetBackupId()), + zap.String("bucketName", request.GetBucketName()), + zap.String("path", request.GetPath()), + zap.Any("resp", resp)) + } else { + log.Info("finish GetBackupRequest", + zap.String("requestId", request.GetRequestId()), + zap.String("backupName", request.GetBackupName()), + zap.String("backupId", request.GetBackupId()), + zap.String("bucketName", request.GetBucketName()), + zap.String("path", request.GetPath())) + } + return resp }