77 "sync"
88 "time"
99
10- "go.uber.org/zap"
11-
1210 "github.com/PythonHacker24/linux-acl-management-backend/internal/types"
1311)
1412
@@ -25,14 +23,6 @@ func getPathLock(path string) *sync.Mutex {
2523func (p * PermProcessor ) HandleLocalTransaction (txn * types.Transaction , absolutePath string ) error {
2624 aclEntry := BuildACLEntry (txn .Entries )
2725
28- /* REMOVE THIS */
29- zap .L ().Info ("ACL Request recieved" ,
30- zap .String ("Transaction ID" , txn .ID .String ()),
31- zap .String ("Action" , txn .Entries .Action ),
32- zap .String ("Entry" , aclEntry ),
33- zap .String ("Path" , absolutePath ),
34- )
35-
3626 /* lock the file path for thread safety (ensure unlock even on panic) */
3727 lock := getPathLock (absolutePath )
3828 lock .Lock ()
@@ -65,25 +55,12 @@ func (p *PermProcessor) HandleLocalTransaction(txn *types.Transaction, absoluteP
6555 txn .ExecStatus = false
6656 txn .ErrorMsg = err .Error ()
6757
68- /* REMOVE THIS */
69- zap .L ().Error ("ACL command failed" ,
70- zap .String ("Transaction ID" , txn .ID .String ()),
71- zap .String ("Output" , string (output )),
72- zap .Error (err ),
73- )
74-
75- txn .ErrorMsg = fmt .Sprintf ("setfacl failed: %w, output: %s" , err , output )
58+ txn .ErrorMsg = fmt .Sprintf ("setfacl failed: %s, output: %s" , err .Error (), output )
7659 }
7760
7861 txn .Status = types .StatusSuccess
7962 txn .ExecStatus = true
8063
81- /* REMOVE THIS */
82- zap .L ().Info ("ACL command executed successfully" ,
83- zap .String ("Transaction ID" , txn .ID .String ()),
84- zap .String ("Output" , string (output )),
85- )
86-
8764 return nil
8865}
8966
0 commit comments