[Update] Logger

This commit is contained in:
trunglt251292 2022-10-10 14:58:41 +07:00
parent 0a74a2c031
commit 5d864de6ce
3 changed files with 2 additions and 11 deletions

View File

@ -2,8 +2,8 @@ package audit
import (
"context"
"fmt"
"git.selly.red/Selly-Modules/logger"
"git.selly.red/Selly-Modules/mongodb"
)
@ -47,10 +47,6 @@ func (s Service) Create(payload CreatePayload) {
// Insert to db
colName := getColName(payload.Target)
if _, err := s.DB.Collection(colName).InsertOne(ctx, doc); err != nil {
logger.Error("audit - Create", logger.LogData{
Source: "audit.action_create.Create",
Message: err.Error(),
Data: payload,
})
fmt.Println("audit - Create", err.Error())
}
}

1
go.mod
View File

@ -3,7 +3,6 @@ module git.selly.red/Selly-Modules/audit
go 1.16
require (
git.selly.red/Selly-Modules/logger v0.0.3-0.20221010034051-82b204026f8c // indirect
git.selly.red/Selly-Modules/mongodb v1.0.6-0.20221010033754-1d897a0f9ea2 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/golang/snappy v0.0.4 // indirect

4
go.sum
View File

@ -1,7 +1,3 @@
git.selly.red/Selly-Modules/logger v0.0.2 h1:ZchJbOBN26K11qmfgCtkF2eO2h7ldIKGG5SbQzmgBEE=
git.selly.red/Selly-Modules/logger v0.0.2/go.mod h1:kvXfyQNzXgdHfbocMCtUssRXicVKdwJahAKLKMJD1uU=
git.selly.red/Selly-Modules/logger v0.0.3-0.20221010034051-82b204026f8c h1:eqGjWFibI3/7ovg9fGBx//E/I2HyydnkstphghcLiQI=
git.selly.red/Selly-Modules/logger v0.0.3-0.20221010034051-82b204026f8c/go.mod h1:q1q2tXmja+vOKo3IU7qZhRXaEBB5jETxHqUlYHsAUEQ=
git.selly.red/Selly-Modules/mongodb v1.0.4 h1:zAtqmW+RLnNpAlB+bu2s7FE02D9AuptFjjx9KrbStRI=
git.selly.red/Selly-Modules/mongodb v1.0.4/go.mod h1:OhqdqYqh8WqEEruz6U27Wu1kKoBLwIUQsc+56xl0Wcs=
git.selly.red/Selly-Modules/mongodb v1.0.6-0.20221010033754-1d897a0f9ea2 h1:bePzcMN/j4V1fvz6UUrN01ey1tkE0w+m5Qj3LtoZs4E=