feat(weather): Add Weather app logging#404
Conversation
Add OSLog categories for the Weather example app and emit useful runtime logs for app launch, location selection, settings changes, and weather service requests. Also add the local XcodeBuildMCP development MCP server configuration. Co-Authored-By: Codex <noreply@openai.com>
commit: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 8bedaf3. Configure here.
| init() { | ||
| let useMock = ProcessInfo.processInfo.arguments.contains("--mock-weather-api") | ||
| weatherService = AppWeatherServiceFactory.makeService() | ||
| AppLog.app.notice("launch service=\(useMock ? "mock" : "production", privacy: .public)") |
There was a problem hiding this comment.
Log message decoupled from actual service selection
Low Severity
The useMock variable independently checks ProcessInfo.processInfo.arguments for the --mock-weather-api flag, but the actual service is created by AppWeatherServiceFactory.makeService() which performs its own independent check. The log message reports based on useMock, not the actual service that was constructed. If the factory's logic ever diverges (e.g., adding environment variable fallback, renaming the flag), the log will silently lie about which service is running — exactly the kind of mismatch this logging PR is trying to help debug.
Reviewed by Cursor Bugbot for commit 8bedaf3. Configure here.


Add structured OSLog instrumentation to the Weather example app.
The example now logs app launch mode, location selection and preview events, settings changes, and weather service request timing/results. This makes it easier to verify launch arguments such as
--mock-weather-apiand inspect runtime behavior when driving the app through XcodeBuildMCP.The PR also adds the local
xcodebuildmcp-devMCP server entry to.mcp.jsonfor easier local development against the built CLI.Validated by building the Weather example for iOS Simulator with XcodeBuildMCP. The repository pre-commit hook also ran format check, lint, and build.