Skip to content

Commit 6dd2cf2

Browse files
committed
add delete logs
1 parent feda209 commit 6dd2cf2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

code/go/0chain.net/blobbercore/allocation/allocationchange.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ func (cc *AllocationChangeCollector) ApplyChanges(ctx context.Context, allocatio
231231
if err != nil {
232232
return rootRef, err
233233
}
234+
logging.Logger.Info("ApplyChanges", zap.String("allocation_id", cc.AllocationID), zap.Any("root_ref", *rootRef))
234235
err = collector.Finalize(ctx)
235236
return rootRef, err
236237
}

code/go/0chain.net/blobbercore/reference/object.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import (
66

77
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/datastore"
88
"github.com/0chain/blobber/code/go/0chain.net/core/common"
9+
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
10+
"go.uber.org/zap"
911
)
1012

1113
func DeleteObject(ctx context.Context, rootRef *Ref, allocationID, objPath string, ts common.Timestamp) error {
@@ -35,7 +37,7 @@ func DeleteObject(ctx context.Context, rootRef *Ref, allocationID, objPath strin
3537
return nil
3638
}
3739
parentPath, deleteFileName := filepath.Split(objPath)
38-
40+
logging.Logger.Info("delete_object", zap.String("parent_path", parentPath), zap.String("delete_file_name", deleteFileName))
3941
rootRef.UpdatedAt = ts
4042
fields, err := common.GetPathFields(parentPath)
4143
if err != nil {
@@ -61,7 +63,7 @@ func DeleteObject(ctx context.Context, rootRef *Ref, allocationID, objPath strin
6163
return common.NewError("invalid_reference_path", "Reference path has invalid references")
6264
}
6365
}
64-
66+
logging.Logger.Info("delete_object", zap.Any("dir_ref", dirRef))
6567
for i, child := range dirRef.Children {
6668
if child.Name == deleteFileName {
6769
dirRef.RemoveChild(i)

0 commit comments

Comments
 (0)