Skip to content

Commit

Permalink
disk: Improve disk server log
Browse files Browse the repository at this point in the history
It's better to differentiate disk server log from spdk engine
server disk API log.

Signed-off-by: Shuo Wu <shuo.wu@suse.com>
  • Loading branch information
shuo-wu authored and David Ko committed Jun 20, 2023
1 parent f3edb26 commit 89cbf32
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/disk/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewServer(spdkEnabled bool, spdkServiceAddress string, shutdownCh chan erro
}

if spdkEnabled {
logrus.Info("Creating SPDK client since SPDK is enabled")
logrus.Info("Disk Server: Creating SPDK client since SPDK is enabled")

if !util.IsSPDKTgtReady(spdkTgtReadinessProbeTimeout) {
return nil, fmt.Errorf("spdk_tgt is not ready in %v", spdkTgtReadinessProbeTimeout)
Expand All @@ -67,7 +67,7 @@ func (s *Server) startMonitoring() {
for {
select {
case <-s.shutdownCh:
logrus.Info("Disk gRPC Server is shutting down")
logrus.Info("Disk Server: Shutting down")
return
}
}
Expand All @@ -93,7 +93,7 @@ func (s *Server) DiskCreate(ctx context.Context, req *rpc.DiskCreateRequest) (*r
"blockSize": req.BlockSize,
})

log.Info("Creating disk")
log.Info("Disk Server: Creating disk")

if req.DiskName == "" || req.DiskPath == "" {
return nil, grpcstatus.Error(grpccodes.InvalidArgument, "disk name and disk path are required")
Expand All @@ -120,7 +120,7 @@ func (s *Server) DiskDelete(ctx context.Context, req *rpc.DiskDeleteRequest) (*e
"diskUUID": req.DiskUuid,
})

log.Info("Deleting disk")
log.Info("Disk Server: Deleting disk")

if req.DiskName == "" || req.DiskUuid == "" {
return nil, grpcstatus.Error(grpccodes.InvalidArgument, "disk name and disk UUID are required")
Expand All @@ -144,7 +144,7 @@ func (s *Server) DiskGet(ctx context.Context, req *rpc.DiskGetRequest) (*rpc.Dis
"diskPath": req.DiskPath,
})

log.Trace("Getting disk info")
log.Trace("Disk Server: Getting disk info")

if req.DiskName == "" || req.DiskPath == "" {
return nil, grpcstatus.Error(grpccodes.InvalidArgument, "disk name and disk path are required")
Expand All @@ -171,7 +171,7 @@ func (s *Server) DiskReplicaInstanceList(ctx context.Context, req *rpc.DiskRepli
"diskName": req.DiskName,
})

log.Trace("Listing disk replica instances")
log.Trace("Disk Server: Listing disk replica instances")

if req.DiskName == "" {
return nil, grpcstatus.Error(grpccodes.InvalidArgument, "disk name is required")
Expand Down Expand Up @@ -206,7 +206,7 @@ func (s *Server) DiskReplicaInstanceDelete(ctx context.Context, req *rpc.DiskRep
"replciaInstanceName": req.ReplciaInstanceName,
})

log.Info("Deleting disk replica instance")
log.Info("Disk Server: Deleting disk replica instance")

if req.DiskName == "" || req.DiskUuid == "" || req.ReplciaInstanceName == "" {
return nil, grpcstatus.Error(grpccodes.InvalidArgument, "disk name, disk UUID and replica instance name are required")
Expand Down

0 comments on commit 89cbf32

Please sign in to comment.