@@ -44,7 +44,6 @@ func GetGames(w http.ResponseWriter, r *http.Request) {
4444 sortDir := r .URL .Query ().Get ("sortDir" )
4545 filter := r .URL .Query ().Get ("filter" )
4646
47- log .Debug ("listing games" , "user_id" , userID , "search" , searchQuery , "sortBy" , sortBy , "sortDir" , sortDir , "filter" , filter )
4847 filters := & db.GetGamesFilters {
4948 Search : searchQuery ,
5049 SortField : sortBy ,
@@ -105,18 +104,14 @@ func CreateGame(w http.ResponseWriter, r *http.Request) {
105104 game .Public = * req .Public
106105 }
107106
108- log .Debug ("creating game" , "user_id" , user .ID , "name" , game .Name )
109107 if err := db .CreateGame (r .Context (), user .ID , & game ); err != nil {
110- log .Debug ("game creation failed" , "error" , err )
111108 if appErr , ok := err .(* obj.AppError ); ok {
112109 httpx .WriteAppError (w , appErr )
113110 return
114111 }
115112 httpx .WriteError (w , http .StatusInternalServerError , "Failed to create game: " + err .Error ())
116113 return
117114 }
118- log .Debug ("game created" , "game_id" , game .ID )
119-
120115 created , err := db .GetGameByID (r .Context (), & user .ID , game .ID )
121116 if err != nil {
122117 httpx .WriteError (w , http .StatusInternalServerError , "Failed to load created game: " + err .Error ())
@@ -150,8 +145,6 @@ func GetGameByID(w http.ResponseWriter, r *http.Request) {
150145 userID = & user .ID
151146 }
152147
153- log .Debug ("getting game by ID" , "game_id" , gameID , "user_id" , userID )
154-
155148 game , err := db .GetGameByID (r .Context (), userID , gameID )
156149 if err != nil {
157150 httpx .WriteError (w , http .StatusNotFound , "Game not found" )
@@ -185,8 +178,6 @@ func UpdateGame(w http.ResponseWriter, r *http.Request) {
185178
186179 user := httpx .UserFromRequest (r )
187180
188- log .Debug ("updating game" , "game_id" , gameID , "user_id" , user .ID )
189-
190181 var updatedGame obj.Game
191182 if err := httpx .ReadJSON (r , & updatedGame ); err != nil {
192183 httpx .WriteError (w , http .StatusBadRequest , "Invalid JSON: " + err .Error ())
@@ -240,21 +231,16 @@ func DeleteGame(w http.ResponseWriter, r *http.Request) {
240231
241232 user := httpx .UserFromRequest (r )
242233
243- log .Debug ("deleting game" , "game_id" , gameID , "user_id" , user .ID )
244-
245234 deleted , err := db .GetGameByID (r .Context (), & user .ID , gameID )
246235 if err != nil {
247236 httpx .WriteError (w , http .StatusNotFound , "Game not found" )
248237 return
249238 }
250239
251240 if err := db .DeleteGame (r .Context (), user .ID , gameID ); err != nil {
252- log .Debug ("game deletion failed" , "game_id" , gameID , "error" , err )
253241 httpx .WriteError (w , http .StatusInternalServerError , "Failed to delete game: " + err .Error ())
254242 return
255243 }
256- log .Debug ("game deleted" , "game_id" , gameID )
257-
258244 httpx .WriteJSON (w , http .StatusOK , deleted )
259245}
260246
@@ -281,8 +267,6 @@ func CloneGame(w http.ResponseWriter, r *http.Request) {
281267
282268 user := httpx .UserFromRequest (r )
283269
284- log .Debug ("cloning game" , "game_id" , gameID , "user_id" , user .ID )
285-
286270 // Get the source game (allow cloning public games or own games)
287271 sourceGame , err := db .GetGameByID (r .Context (), nil , gameID )
288272 if err != nil {
@@ -321,18 +305,13 @@ func CloneGame(w http.ResponseWriter, r *http.Request) {
321305 OriginallyCreatedBy : originalCreator ,
322306 }
323307
324- log .Debug ("creating cloned game" , "user_id" , user .ID , "source_game_id" , gameID , "name" , clonedGame .Name )
325308 if err := db .CreateGame (r .Context (), user .ID , & clonedGame ); err != nil {
326- log .Debug ("game clone failed" , "error" , err )
327309 httpx .WriteError (w , http .StatusInternalServerError , "Failed to clone game: " + err .Error ())
328310 return
329311 }
330- log .Debug ("game cloned" , "new_game_id" , clonedGame .ID )
331-
332312 // Increment the clone count on the source game
333313 if err := db .IncrementGameCloneCount (r .Context (), gameID ); err != nil {
334- log .Debug ("failed to increment clone count" , "error" , err )
335- // Don't fail the request, just log the error
314+ log .Warn ("failed to increment clone count" , "error" , err )
336315 }
337316
338317 created , err := db .GetGameByID (r .Context (), & user .ID , clonedGame .ID )
0 commit comments