Skip to content

Commit

Permalink
Added logger to request creation for better diagnostics.
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdoe committed Dec 12, 2024
1 parent cfc1975 commit 1f1a4b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CCMenu/Source/Server Monitor/GitHubAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import Foundation
import Combine
import os


class GitHubAPI {
Expand Down Expand Up @@ -127,6 +128,10 @@ class GitHubAPI {
if let token, !token.isEmpty {
request.setValue(URLRequest.bearerAuthValue(token: token), forHTTPHeaderField: "Authorization")
}

let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "application")
logger.trace("Request: \(method, privacy: .public) \(url.absoluteString, privacy: .public)")

return request
}

Expand Down
3 changes: 0 additions & 3 deletions CCMenu/Source/Server Monitor/GitHubFeedReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ class GitHubFeedReader {
guard let request = GitHubAPI.requestForFeed(feed: pipeline.feed, token: token) else {
throw GithHubFeedReaderError.invalidURLError
}
#if DEBUG
debugPrint(Date(), "fetching", request.url ?? "")
#endif
guard let newStatus = try await fetchStatus(request: request) else {
throw GithHubFeedReaderError.noStatusError
}
Expand Down

0 comments on commit 1f1a4b7

Please sign in to comment.