From 58d448a678c5a8a381be43166b8f9ae504c00f0c Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Fri, 31 May 2024 00:09:53 -0700 Subject: [PATCH] Create all notification/request handling signposts in the same logging category MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This shows up nicer in Instruments because it doesn’t open a new lane for every signpost. Instead, they all share the same lane. Concurrent signposts are still shown as overlapping. --- Sources/SourceKitLSP/SourceKitLSPServer.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/SourceKitLSP/SourceKitLSPServer.swift b/Sources/SourceKitLSP/SourceKitLSPServer.swift index 51132453c..e883345c7 100644 --- a/Sources/SourceKitLSP/SourceKitLSPServer.swift +++ b/Sources/SourceKitLSP/SourceKitLSPServer.swift @@ -541,7 +541,7 @@ extension SourceKitLSPServer: MessageHandler { let notificationID = notificationIDForLogging.fetchAndIncrement() - let signposter = Logger(subsystem: LoggingScope.subsystem, category: "notification-\(notificationID)") + let signposter = Logger(subsystem: LoggingScope.subsystem, category: "message-handling") .makeSignposter() let signpostID = signposter.makeSignpostID() let state = signposter.beginInterval("Notification", id: signpostID, "\(type(of: params))") @@ -591,7 +591,7 @@ extension SourceKitLSPServer: MessageHandler { id: RequestID, reply: @Sendable @escaping (LSPResult) -> Void ) { - let signposter = Logger(subsystem: LoggingScope.subsystem, category: "request-\(id)").makeSignposter() + let signposter = Logger(subsystem: LoggingScope.subsystem, category: "message-handling").makeSignposter() let signpostID = signposter.makeSignpostID() let state = signposter.beginInterval("Request", id: signpostID, "\(R.self)")