summaryrefslogtreecommitdiff
path: root/Hutch
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-12 10:11:21 -0500
committerChristian Cleberg <[email protected]>2026-04-12 10:11:21 -0500
commitc0744a35891f89e50ab407a0b8557ce9d5c5e6cc (patch)
treee4b40e8425ded8213be34ba31286fb723dcb8ccb /Hutch
parent9050405b4f33b2b9b70458fcf3e43b80c940eef7 (diff)
downloadhutch-2.15.1.tar.gz
hutch-2.15.1.tar.bz2
hutch-2.15.1.zip
chore: clean up debug loggingv2.15.1
Diffstat (limited to 'Hutch')
-rw-r--r--Hutch/Networking/HutchStatsService.swift12
-rw-r--r--Hutch/Views/Builds/BuildDetailViewModel.swift4
-rw-r--r--Hutch/Views/Lookup/ContributionCalendarViewModel.swift12
-rw-r--r--Hutch/Views/Lookup/LookupView.swift4
-rw-r--r--Hutch/Views/Lookup/UserProfileViewModel.swift16
5 files changed, 0 insertions, 48 deletions
diff --git a/Hutch/Networking/HutchStatsService.swift b/Hutch/Networking/HutchStatsService.swift
index cb08715..69a2a20 100644
--- a/Hutch/Networking/HutchStatsService.swift
+++ b/Hutch/Networking/HutchStatsService.swift
@@ -20,7 +20,6 @@ struct HutchStatsService: ContributionCalendarServing {
}
func fetchContributionCalendar(actor: String, endingOn endDate: Date) async throws -> ContributionCalendarResponse {
- debugLog("calendar request actor=\(actor) endDate=\(Self.rangeFormatter.string(from: endDate))")
return try await fetch(
path: "api/contributions/\(actor)",
queryItems: trailingYearQueryItems(endingOn: endDate),
@@ -29,7 +28,6 @@ struct HutchStatsService: ContributionCalendarServing {
}
func fetchContributionStats(actor: String, endingOn endDate: Date) async throws -> ContributionStatsResponse {
- debugLog("stats request actor=\(actor) endDate=\(Self.rangeFormatter.string(from: endDate))")
return try await fetch(
path: "api/contributions/\(actor)/stats",
queryItems: trailingYearQueryItems(endingOn: endDate),
@@ -53,17 +51,14 @@ struct HutchStatsService: ContributionCalendarServing {
throw URLError(.badURL)
}
- debugLog("request \(url.absoluteString)")
let (data, response): (Data, URLResponse)
do {
(data, response) = try await session.data(from: url)
} catch {
- debugLog("network failure \(url.absoluteString) error=\(error.localizedDescription)")
throw SRHTError.networkError(error)
}
if let httpResponse = response as? HTTPURLResponse {
- debugLog("response \(url.absoluteString) status=\(httpResponse.statusCode) bytes=\(data.count)")
if !(200...299).contains(httpResponse.statusCode) {
throw SRHTError.httpError(httpResponse.statusCode)
}
@@ -72,8 +67,6 @@ struct HutchStatsService: ContributionCalendarServing {
do {
return try decoder.decode(responseType, from: data)
} catch {
- let preview = String(decoding: data.prefix(300), as: UTF8.self)
- debugLog("decode failure \(url.absoluteString) error=\(error.localizedDescription) body=\(preview)")
throw SRHTError.decodingError(error)
}
}
@@ -113,9 +106,4 @@ struct HutchStatsService: ContributionCalendarServing {
return formatter
}()
- private func debugLog(_ message: String) {
-#if DEBUG
- print("[HutchStatsService] \(message)")
-#endif
- }
}
diff --git a/Hutch/Views/Builds/BuildDetailViewModel.swift b/Hutch/Views/Builds/BuildDetailViewModel.swift
index ec4d265..88b9e42 100644
--- a/Hutch/Views/Builds/BuildDetailViewModel.swift
+++ b/Hutch/Views/Builds/BuildDetailViewModel.swift
@@ -315,8 +315,6 @@ final class BuildDetailViewModel {
guard autoRefreshTask == nil else { return }
guard shouldAutoRefresh else { return }
- print("Build auto-refresh started")
-
autoRefreshTask = Task { [weak self] in
while !Task.isCancelled {
do {
@@ -336,7 +334,6 @@ final class BuildDetailViewModel {
autoRefreshTask.cancel()
self.autoRefreshTask = nil
- print("Build auto-refresh stopped")
}
private var shouldAutoRefresh: Bool {
@@ -352,7 +349,6 @@ final class BuildDetailViewModel {
return
}
- print("Build refresh tick")
await loadJob()
await loadBuildLog()
}
diff --git a/Hutch/Views/Lookup/ContributionCalendarViewModel.swift b/Hutch/Views/Lookup/ContributionCalendarViewModel.swift
index 1ff789d..acbae2d 100644
--- a/Hutch/Views/Lookup/ContributionCalendarViewModel.swift
+++ b/Hutch/Views/Lookup/ContributionCalendarViewModel.swift
@@ -116,8 +116,6 @@ final class ContributionCalendarViewModel {
isLoading = true
loadErrorMessage = nil
defer { isLoading = false }
- debugLog("load start actor=\(actor) endDate=\(selectedEndDate.formatted(date: .abbreviated, time: .omitted))")
-
let fetchedCalendar: ContributionCalendarResponse?
let fetchedStats: ContributionStatsResponse?
var errors: [any Error] = []
@@ -147,11 +145,6 @@ final class ContributionCalendarViewModel {
loadErrorMessage = errors.first?.userFacingMessage
}
- debugLog(
- "load complete actor=\(actor) endDate=\(selectedEndDate.formatted(date: .abbreviated, time: .omitted)) state=\(String(describing: displayState)) " +
- "calendarDays=\(calendar?.days.count ?? 0) totalEvents=\(stats?.totalEvents ?? 0) " +
- "indexingState=\(String(describing: effectiveIndexingState)) error=\(loadErrorMessage ?? "none")"
- )
}
func selectPreviousYear() async {
@@ -196,9 +189,4 @@ final class ContributionCalendarViewModel {
return normalizedStartDate...normalizedEndDate
}
- private func debugLog(_ message: String) {
-#if DEBUG
- print("[ContributionCalendarViewModel] \(message)")
-#endif
- }
}
diff --git a/Hutch/Views/Lookup/LookupView.swift b/Hutch/Views/Lookup/LookupView.swift
index e571140..e0adc6b 100644
--- a/Hutch/Views/Lookup/LookupView.swift
+++ b/Hutch/Views/Lookup/LookupView.swift
@@ -201,8 +201,6 @@ final class LookupViewModel {
}
"""
- lookupLogger.debug("Looking up user profile for username: \(username, privacy: .public)")
-
let result: Response
do {
result = try await client.execute(
@@ -225,8 +223,6 @@ final class LookupViewModel {
throw error
}
- lookupLogger.debug("User lookup succeeded for username: \(username, privacy: .public)")
-
return .user(result.user)
}
diff --git a/Hutch/Views/Lookup/UserProfileViewModel.swift b/Hutch/Views/Lookup/UserProfileViewModel.swift
index 143cb6f..56c2852 100644
--- a/Hutch/Views/Lookup/UserProfileViewModel.swift
+++ b/Hutch/Views/Lookup/UserProfileViewModel.swift
@@ -85,8 +85,6 @@ final class UserProfileViewModel {
defer { isLoadingContributions = false }
let resolvedEndDate = Calendar.contributionCalendar.startOfDay(for: endDate ?? Date())
- debugLog("profile contributions start actor=\(actor) endDate=\(resolvedEndDate.formatted(date: .abbreviated, time: .omitted))")
-
do {
async let contributionCalendar = statsService.fetchContributionCalendar(actor: actor, endingOn: resolvedEndDate)
async let contributionStats = statsService.fetchContributionStats(actor: actor, endingOn: resolvedEndDate)
@@ -96,17 +94,8 @@ final class UserProfileViewModel {
if contributionDisplayState != .unavailable {
contributionsError = nil
}
- debugLog(
- "profile contributions complete actor=\(actor) endDate=\(resolvedEndDate.formatted(date: .abbreviated, time: .omitted)) " +
- "state=\(String(describing: contributionDisplayState)) days=\(self.contributionCalendar?.days.count ?? 0) " +
- "totalEvents=\(self.contributionStats?.totalEvents ?? 0) error=\(contributionsError ?? "none")"
- )
} catch {
contributionsError = error.userFacingMessage
- debugLog(
- "profile contributions failed actor=\(actor) endDate=\(resolvedEndDate.formatted(date: .abbreviated, time: .omitted)) " +
- "error=\(error.localizedDescription) userFacing=\(contributionsError ?? "none")"
- )
}
}
@@ -232,9 +221,4 @@ final class UserProfileViewModel {
}
}
- private func debugLog(_ message: String) {
-#if DEBUG
- print("[UserProfileViewModel] \(message)")
-#endif
- }
}