From 4fa3f01432805d0ee1e1084489ea178017b0866e Mon Sep 17 00:00:00 2001
From: Ruslan Vakilov <supaflyster@gmail.com>
Date: Sun, 22 Sep 2024 10:05:29 +0200
Subject: [PATCH 1/3] Log only client name when adding or modifying

---
 handler/routes.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/handler/routes.go b/handler/routes.go
index ede3654..17aa4ba 100644
--- a/handler/routes.go
+++ b/handler/routes.go
@@ -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)
 	}
@@ -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"})
 	}
@@ -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.Name)
 		return c.JSON(http.StatusOK, jsonHTTPResponse{true, "Client removed"})
 	}
 }

From 27c6447c7475b1016aaf7b43be0889f2f72858f7 Mon Sep 17 00:00:00 2001
From: Ruslan Vakilov <supaflyster@gmail.com>
Date: Sun, 22 Sep 2024 10:37:52 +0200
Subject: [PATCH 2/3] Change description of keypair update log and remove
 logging of key pairs

---
 handler/routes.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/handler/routes.go b/handler/routes.go
index 17aa4ba..93be480 100644
--- a/handler/routes.go
+++ b/handler/routes.go
@@ -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)
 	}

From 510ba54a21cad017f04806a0fa48edab1d96dd87 Mon Sep 17 00:00:00 2001
From: Ruslan Vakilov <supaflyster@gmail.com>
Date: Sun, 22 Sep 2024 21:19:53 +0200
Subject: [PATCH 3/3] Log client ID when removing client.

---
 handler/routes.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/handler/routes.go b/handler/routes.go
index 93be480..92302c8 100644
--- a/handler/routes.go
+++ b/handler/routes.go
@@ -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.Name)
+		log.Infof("Removed wireguard client: %v", client.ID)
 		return c.JSON(http.StatusOK, jsonHTTPResponse{true, "Client removed"})
 	}
 }