Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log only client name when adding or modifying #625

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions handler/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ func NewClient(db store.IStore) echo.HandlerFunc {
false, err.Error(),
})
}
log.Infof("Created wireguard client: %v", client)
log.Infof("Created wireguard client: %v", client.Name)

return c.JSON(http.StatusOK, client)
}
Expand Down Expand Up @@ -726,7 +726,7 @@ func UpdateClient(db store.IStore) echo.HandlerFunc {
if err := db.SaveClient(client); err != nil {
return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, err.Error()})
}
log.Infof("Updated client information successfully => %v", client)
log.Infof("Updated client information successfully => %v", client.Name)

return c.JSON(http.StatusOK, jsonHTTPResponse{true, "Updated client successfully"})
}
Expand Down Expand Up @@ -821,7 +821,7 @@ func RemoveClient(db store.IStore) echo.HandlerFunc {
return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot delete client from database"})
}

log.Infof("Removed wireguard client: %v", client)
log.Infof("Removed wireguard client: %v", client.ID)
return c.JSON(http.StatusOK, jsonHTTPResponse{true, "Client removed"})
}
}
Expand Down Expand Up @@ -885,7 +885,7 @@ func WireGuardServerKeyPair(db store.IStore) echo.HandlerFunc {
if err := db.SaveServerKeyPair(serverKeyPair); err != nil {
return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot generate Wireguard key pair"})
}
log.Infof("Updated wireguard server interfaces settings: %v", serverKeyPair)
log.Infof("Updated wireguard server keypairs")

return c.JSON(http.StatusOK, serverKeyPair)
}
Expand Down