Remove too many debug messages

This commit is contained in:
2024-12-19 22:00:42 +01:00
parent 0aa67f5cc2
commit b065938211
26 changed files with 75 additions and 586 deletions

View File

@@ -344,7 +344,7 @@ func (h *Handler) AdminUpdateUser() http.HandlerFunc {
return
}
log.Info("user updated",
log.Debug("user updated",
"targetUserID", userID,
"updates", updates,
)

View File

@@ -124,7 +124,7 @@ func (h *Handler) Login(authManager auth.SessionManager, cookieService auth.Cook
ExpiresAt: session.ExpiresAt,
}
log.Info("user logged in successfully",
log.Debug("user logged in",
"userID", user.ID,
"email", user.Email,
"role", user.Role,

View File

@@ -73,9 +73,6 @@ func (h *Handler) ListFiles() http.HandlerFunc {
return
}
log.Debug("files listed successfully",
"fileCount", len(files),
)
respondJSON(w, files)
}
}
@@ -129,10 +126,6 @@ func (h *Handler) LookupFileByName() http.HandlerFunc {
return
}
log.Debug("file lookup successful",
"filename", filename,
"matchCount", len(filePaths),
)
respondJSON(w, &LookupResponse{Paths: filePaths})
}
}
@@ -203,11 +196,6 @@ func (h *Handler) GetFileContent() http.HandlerFunc {
respondError(w, "Failed to write response", http.StatusInternalServerError)
return
}
log.Debug("file content retrieved",
"filePath", filePath,
"contentSize", len(content),
)
}
}
@@ -276,11 +264,6 @@ func (h *Handler) SaveFile() http.HandlerFunc {
UpdatedAt: time.Now().UTC(),
}
log.Debug("file saved",
"filePath", filePath,
"size", response.Size,
"updatedAt", response.UpdatedAt,
)
respondJSON(w, response)
}
}
@@ -339,9 +322,6 @@ func (h *Handler) DeleteFile() http.HandlerFunc {
return
}
log.Debug("file deleted",
"filePath", filePath,
)
w.WriteHeader(http.StatusNoContent)
}
}
@@ -389,9 +369,6 @@ func (h *Handler) GetLastOpenedFile() http.HandlerFunc {
return
}
log.Debug("last opened file retrieved successfully",
"filePath", filePath,
)
respondJSON(w, &LastOpenedFileResponse{LastOpenedFilePath: filePath})
}
}
@@ -473,9 +450,6 @@ func (h *Handler) UpdateLastOpenedFile() http.HandlerFunc {
return
}
log.Debug("last opened file updated successfully",
"filePath", requestBody.FilePath,
)
w.WriteHeader(http.StatusNoContent)
}
}

View File

@@ -78,11 +78,6 @@ func (h *Handler) StageCommitAndPush() http.HandlerFunc {
return
}
log.Debug("git operations completed successfully",
"commitHash", hash.String(),
"commitMessage", requestBody.Message,
)
respondJSON(w, CommitResponse{CommitHash: hash.String()})
}
}
@@ -120,7 +115,6 @@ func (h *Handler) PullChanges() http.HandlerFunc {
return
}
log.Debug("successfully pulled changes from remote")
respondJSON(w, PullResponse{Message: "Successfully pulled changes from remote"})
}
}

View File

@@ -51,9 +51,6 @@ func (h *StaticHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// Set cache headers for assets
if strings.HasPrefix(requestedPath, "/assets/") {
w.Header().Set("Cache-Control", "public, max-age=31536000") // 1 year
log.Debug("cache headers set for asset",
"path", requestedPath,
)
}
// Check if file exists (not counting .gz files)
@@ -97,22 +94,11 @@ func (h *StaticHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
contentType = "text/html"
}
w.Header().Set("Content-Type", contentType)
log.Debug("serving gzipped file",
"path", requestedPath,
"gzPath", gzPath,
"contentType", contentType,
)
http.ServeFile(w, r, gzPath)
return
}
}
// Serve original file
log.Debug("serving original file",
"path", requestedPath,
"size", stat.Size(),
"modTime", stat.ModTime(),
)
http.ServeFile(w, r, cleanPath)
}

View File

@@ -118,7 +118,7 @@ func (h *Handler) UpdateProfile() http.HandlerFunc {
// Handle email update if requested
if req.Email != "" && req.Email != user.Email {
if req.CurrentPassword == "" {
log.Debug("email change attempted without current password")
log.Warn("attempted email change without current password")
respondError(w, "Current password is required to change email", http.StatusBadRequest)
return
}
@@ -159,9 +159,6 @@ func (h *Handler) UpdateProfile() http.HandlerFunc {
return
}
log.Debug("profile updated successfully",
"updates", updates,
)
respondJSON(w, user)
}
}

View File

@@ -55,9 +55,6 @@ func (h *Handler) ListWorkspaces() http.HandlerFunc {
return
}
log.Debug("workspaces retrieved successfully",
"count", len(workspaces),
)
respondJSON(w, workspaces)
}
}
@@ -127,11 +124,6 @@ func (h *Handler) CreateWorkspace() http.HandlerFunc {
}
if workspace.GitEnabled {
log.Debug("setting up git repository",
"workspaceID", workspace.ID,
"gitURL", workspace.GitURL,
)
if err := h.Storage.SetupGitRepo(
ctx.UserID,
workspace.ID,
@@ -260,10 +252,6 @@ func (h *Handler) UpdateWorkspace() http.HandlerFunc {
// Handle Git repository setup/teardown if Git settings changed
if changes["gitSettings"] {
if workspace.GitEnabled {
log.Debug("updating git repository configuration",
"gitURL", workspace.GitURL,
)
if err := h.Storage.SetupGitRepo(
ctx.UserID,
ctx.Workspace.ID,
@@ -280,7 +268,6 @@ func (h *Handler) UpdateWorkspace() http.HandlerFunc {
return
}
} else {
log.Debug("disabling git repository")
h.Storage.DisableGitRepo(ctx.UserID, ctx.Workspace.ID)
}
}
@@ -293,9 +280,6 @@ func (h *Handler) UpdateWorkspace() http.HandlerFunc {
return
}
log.Debug("workspace updated",
"changes", changes,
)
respondJSON(w, workspace)
}
}
@@ -445,9 +429,6 @@ func (h *Handler) GetLastWorkspaceName() http.HandlerFunc {
return
}
log.Debug("last workspace name retrieved",
"workspaceName", workspaceName,
)
respondJSON(w, &LastWorkspaceNameResponse{LastWorkspaceName: workspaceName})
}
}
@@ -497,9 +478,6 @@ func (h *Handler) UpdateLastWorkspaceName() http.HandlerFunc {
return
}
log.Debug("last workspace name updated",
"workspaceName", requestBody.WorkspaceName,
)
w.WriteHeader(http.StatusNoContent)
}
}