Description
Create MacApp/Packages/GitHubIntegration/Sources/GitHubIntegrationClient/GitHubLogger.swift:
import os
public enum GitHubLog {
public static let subsystem = "com.relay.github"
public static let auth = Logger(subsystem: subsystem, category: "auth")
public static let api = Logger(subsystem: subsystem, category: "api")
public static let polling = Logger(subsystem: subsystem, category: "polling")
}
Usage rules (documented in file-level docstring)
auth — sign-in/out events, token validation, state mismatch. Never log token, code, code_verifier, state values. Use privacy: specifier for user-data placeholders.
api — HTTP method + path + status (no body, no Authorization header). Redact query tokens if any.
polling — poll tick start/end (debug), worktree count (debug), rate-limit remaining (notice when low).
- Errors:
logger.error("...", privacy: .private) for user-data placeholders.
- Severity map:
debug (verbose trace), info (normal flow), notice (warning), error (recoverable), fault (programming bug).
print(...) — forbidden in production code paths. Document as project-wide rule in CLAUDE.md (T-16) or as SwiftLint rule.
Pilot usage
Demonstrate usage in GitHubClient.perform(...) (T-5) and GitHubAuthService.signIn (T-7) — any interim print replaced with appropriate GitHubLog category.
Spec reference
See swarm-report/github-integration-decomposition.md#t-15.
Relationships
Acceptance criteria
Complexity
S
Suggested agent
developer-workflow:swift-engineer
Module / Layer
GitHubIntegrationClient / Infrastructure
Description
Create
MacApp/Packages/GitHubIntegration/Sources/GitHubIntegrationClient/GitHubLogger.swift:Usage rules (documented in file-level docstring)
auth— sign-in/out events, token validation, state mismatch. Never logtoken,code,code_verifier,statevalues. Useprivacy:specifier for user-data placeholders.api— HTTP method + path + status (no body, no Authorization header). Redact query tokens if any.polling— poll tick start/end (debug), worktree count (debug), rate-limit remaining (notice when low).logger.error("...", privacy: .private)for user-data placeholders.debug(verbose trace),info(normal flow),notice(warning),error(recoverable),fault(programming bug).print(...)— forbidden in production code paths. Document as project-wide rule in CLAUDE.md (T-16) or as SwiftLint rule.Pilot usage
Demonstrate usage in
GitHubClient.perform(...)(T-5) andGitHubAuthService.signIn(T-7) — any interimprintreplaced with appropriateGitHubLogcategory.Spec reference
See
swarm-report/github-integration-decomposition.md#t-15.Relationships
GitHubLog.auth)GitHubLog.api), T-8b (usesGitHubLog.polling)Acceptance criteria
GitHubLogenum compiles; three categories availableDemoLogging.swiftif T-5 not yet merged)log stream --subsystem com.relay.githubshows expected events in smoke (deferred to T-13 manual verification)print(...)calls introduced in this PRComplexity
S
Suggested agent
developer-workflow:swift-engineerModule / Layer
GitHubIntegrationClient/ Infrastructure