From 9b3f414d274ca15ba1f0cb94302766602d203de2 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Tue, 9 Jun 2026 19:17:15 +0200 Subject: [PATCH] Remove dead `import OSLog` from demo command files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `import OSLog` is only needed where Swift Logging is bridged to OSLog — the `OSLogHandler` and `LoggingSystem.bootstrapWithOSLog()` helpers. The six demo subcommands and `MCPCommand` only *call* `bootstrapWithOSLog()`, which requires no OSLog import, so the import was dead (and it shadowed `Logging.Logger` with `os.Logger`). Drop the `#if canImport(OSLog) import OSLog #endif` blocks from those files, keeping the `#if canImport(OSLog)` guard around the Apple-only `bootstrapWithOSLog()` calls. `import OSLog` now appears only in the bridge files (OSLogHandler.swift / LoggingSystem.swift). Co-Authored-By: Claude Opus 4.8 (1M context) --- Demos/SwiftMCPDemo/Commands/HTTPSSECommand.swift | 3 --- Demos/SwiftMCPDemo/Commands/StdioCommand.swift | 3 --- Demos/SwiftMCPDemo/Commands/TCPBonjourCommand.swift | 3 --- Demos/SwiftMCPDemo/MCPCommand.swift | 4 ---- Demos/SwiftMCPIntentsDemo/Commands/HTTPSSECommand.swift | 3 --- Demos/SwiftMCPIntentsDemo/Commands/StdioCommand.swift | 3 --- Demos/SwiftMCPIntentsDemo/Commands/TCPBonjourCommand.swift | 3 --- 7 files changed, 22 deletions(-) diff --git a/Demos/SwiftMCPDemo/Commands/HTTPSSECommand.swift b/Demos/SwiftMCPDemo/Commands/HTTPSSECommand.swift index 1aa3998..43a1d58 100644 --- a/Demos/SwiftMCPDemo/Commands/HTTPSSECommand.swift +++ b/Demos/SwiftMCPDemo/Commands/HTTPSSECommand.swift @@ -4,9 +4,6 @@ import ArgumentParser import SwiftMCP import Logging import ServiceLifecycle -#if canImport(OSLog) -import OSLog -#endif /** A command that starts an HTTP server with Server-Sent Events (SSE) support for SwiftMCP. diff --git a/Demos/SwiftMCPDemo/Commands/StdioCommand.swift b/Demos/SwiftMCPDemo/Commands/StdioCommand.swift index 5ae9251..e2add09 100644 --- a/Demos/SwiftMCPDemo/Commands/StdioCommand.swift +++ b/Demos/SwiftMCPDemo/Commands/StdioCommand.swift @@ -5,9 +5,6 @@ import SwiftMCP import Logging import NIOCore import ServiceLifecycle -#if canImport(OSLog) -import OSLog -#endif /** A command that processes JSON-RPC requests from standard input and writes responses to standard output. diff --git a/Demos/SwiftMCPDemo/Commands/TCPBonjourCommand.swift b/Demos/SwiftMCPDemo/Commands/TCPBonjourCommand.swift index f725ce3..65dc427 100644 --- a/Demos/SwiftMCPDemo/Commands/TCPBonjourCommand.swift +++ b/Demos/SwiftMCPDemo/Commands/TCPBonjourCommand.swift @@ -4,9 +4,6 @@ import ArgumentParser import SwiftMCP import Logging import ServiceLifecycle -#if canImport(OSLog) -import OSLog -#endif /** A command that exposes the demo server over TCP with Bonjour discovery. diff --git a/Demos/SwiftMCPDemo/MCPCommand.swift b/Demos/SwiftMCPDemo/MCPCommand.swift index 61f6099..8696e69 100644 --- a/Demos/SwiftMCPDemo/MCPCommand.swift +++ b/Demos/SwiftMCPDemo/MCPCommand.swift @@ -5,10 +5,6 @@ import SwiftMCP import Logging import NIOCore import Dispatch - -#if canImport(OSLog) -import OSLog -#endif #endif /** diff --git a/Demos/SwiftMCPIntentsDemo/Commands/HTTPSSECommand.swift b/Demos/SwiftMCPIntentsDemo/Commands/HTTPSSECommand.swift index 46158e2..58ec38b 100644 --- a/Demos/SwiftMCPIntentsDemo/Commands/HTTPSSECommand.swift +++ b/Demos/SwiftMCPIntentsDemo/Commands/HTTPSSECommand.swift @@ -4,9 +4,6 @@ import ArgumentParser import SwiftMCP import Logging import ServiceLifecycle -#if canImport(OSLog) -import OSLog -#endif /** A command that starts an HTTP server with Server-Sent Events (SSE) support for SwiftMCP. diff --git a/Demos/SwiftMCPIntentsDemo/Commands/StdioCommand.swift b/Demos/SwiftMCPIntentsDemo/Commands/StdioCommand.swift index 648f74e..4b775f4 100644 --- a/Demos/SwiftMCPIntentsDemo/Commands/StdioCommand.swift +++ b/Demos/SwiftMCPIntentsDemo/Commands/StdioCommand.swift @@ -5,9 +5,6 @@ import SwiftMCP import Logging import NIOCore import ServiceLifecycle -#if canImport(OSLog) -import OSLog -#endif /** A command that processes JSON-RPC requests from standard input and writes responses to standard output. diff --git a/Demos/SwiftMCPIntentsDemo/Commands/TCPBonjourCommand.swift b/Demos/SwiftMCPIntentsDemo/Commands/TCPBonjourCommand.swift index e7f7f2e..22cfbe7 100644 --- a/Demos/SwiftMCPIntentsDemo/Commands/TCPBonjourCommand.swift +++ b/Demos/SwiftMCPIntentsDemo/Commands/TCPBonjourCommand.swift @@ -4,9 +4,6 @@ import ArgumentParser import SwiftMCP import Logging import ServiceLifecycle -#if canImport(OSLog) -import OSLog -#endif /** A command that exposes the AppIntents demo server over TCP with Bonjour discovery.