diff --git a/Sources/SecretAgent/XPCInputParser.swift b/Sources/SecretAgent/XPCInputParser.swift index 33d179f..b78f316 100644 --- a/Sources/SecretAgent/XPCInputParser.swift +++ b/Sources/SecretAgent/XPCInputParser.swift @@ -2,18 +2,24 @@ import Foundation import SecretAgentKit import Brief import XPCWrappers +import OSLog /// Delegates all agent input parsing to an XPC service which wraps OpenSSH public final class XPCAgentInputParser: SSHAgentInputParserProtocol { + private let logger = Logger(subsystem: "com.maxgoedjen.secretive.secretagent", category: "XPCAgentInputParser") private let session: XPCTypedSession public init() async throws { + logger.debug("Creating XPCAgentInputParser") session = try await XPCTypedSession(serviceName: "com.maxgoedjen.Secretive.SecretAgentInputParser", warmup: true) + logger.debug("XPCAgentInputParser is warmed up.") } public func parse(data: Data) async throws -> SSHAgent.Request { - try await session.send(data) + logger.debug("Parsing input") + defer { logger.debug("Parsed input") } + return try await session.send(data) } deinit {