Satellite: log the project information for upload, download, and list activities (#3651)

This commit is contained in:
Fadila 2019-12-02 15:39:19 +01:00 committed by GitHub
parent 24cacc8adf
commit 526a126a5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1293,6 +1293,7 @@ func (endpoint *Endpoint) GetObject(ctx context.Context, req *pb.ObjectGetReques
index++
}
}
endpoint.log.Info("Get Object", zap.Stringer("Project ID", keyInfo.ProjectID))
return &pb.ObjectGetResponse{
Object: object,
@ -1341,6 +1342,7 @@ func (endpoint *Endpoint) ListObjects(ctx context.Context, req *pb.ObjectListReq
items[i].ExpiresAt = segment.Pointer.ExpirationDate
}
}
endpoint.log.Info("List Objects", zap.Stringer("Project ID", keyInfo.ProjectID))
return &pb.ObjectListResponse{
Items: items,
@ -1394,6 +1396,7 @@ func (endpoint *Endpoint) BeginDeleteObject(ctx context.Context, req *pb.ObjectB
return nil, err
}
endpoint.log.Info("Delete Object", zap.Stringer("Project ID", keyInfo.ProjectID))
return &pb.ObjectBeginDeleteResponse{
StreamId: streamID,
}, nil
@ -1500,6 +1503,8 @@ func (endpoint *Endpoint) BeginSegment(ctx context.Context, req *pb.SegmentBegin
CreationDate: time.Now(),
})
endpoint.log.Info("Segment Upload", zap.Stringer("Project ID", keyInfo.ProjectID))
return &pb.SegmentBeginResponse{
SegmentId: segmentID,
AddressedLimits: addressedLimits,
@ -1719,6 +1724,8 @@ func (endpoint *Endpoint) MakeInlineSegment(ctx context.Context, req *pb.Segment
return nil, rpcstatus.Error(rpcstatus.Internal, err.Error())
}
endpoint.log.Info("Make Inline Segment", zap.Stringer("Project ID", keyInfo.ProjectID))
return &pb.SegmentMakeInlineResponse{}, nil
}
@ -1770,6 +1777,8 @@ func (endpoint *Endpoint) BeginDeleteSegment(ctx context.Context, req *pb.Segmen
CreationDate: time.Now(),
})
endpoint.log.Info("Delete Segment", zap.Stringer("Project ID", keyInfo.ProjectID))
return &pb.SegmentBeginDeleteResponse{
SegmentId: segmentID,
AddressedLimits: limits,
@ -1846,6 +1855,8 @@ func (endpoint *Endpoint) ListSegments(ctx context.Context, req *pb.SegmentListR
return nil, rpcstatus.Error(rpcstatus.Internal, err.Error())
}
endpoint.log.Info("List Segments", zap.Stringer("Project ID", keyInfo.ProjectID))
if streamMeta.NumberOfSegments > 0 {
// use unencrypted number of segments
// TODO cleanup int32 vs int64
@ -2014,6 +2025,7 @@ func (endpoint *Endpoint) DownloadSegment(ctx context.Context, req *pb.SegmentDo
if err != nil {
return nil, rpcstatus.Error(rpcstatus.Internal, err.Error())
}
endpoint.log.Info("Download Segment", zap.Stringer("Project ID", keyInfo.ProjectID))
return &pb.SegmentDownloadResponse{
SegmentId: segmentID,
SegmentSize: pointer.SegmentSize,
@ -2037,6 +2049,8 @@ func (endpoint *Endpoint) DownloadSegment(ctx context.Context, req *pb.SegmentDo
}
}
endpoint.log.Info("Download Segment", zap.Stringer("Project ID", keyInfo.ProjectID))
return &pb.SegmentDownloadResponse{
SegmentId: segmentID,
AddressedLimits: limits,