From 3cf2cd7d207c11a01557811a08252fe1dbddbc87 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Fri, 12 Jul 2024 14:44:56 -0400 Subject: [PATCH] Improve `TopicClientExtensions` logging --- .../Extensions/TopicClientExtensions.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Tgstation.Server.Host/Extensions/TopicClientExtensions.cs b/src/Tgstation.Server.Host/Extensions/TopicClientExtensions.cs index 3a7fb56403..55ead2144a 100644 --- a/src/Tgstation.Server.Host/Extensions/TopicClientExtensions.cs +++ b/src/Tgstation.Server.Host/Extensions/TopicClientExtensions.cs @@ -16,6 +16,11 @@ namespace Tgstation.Server.Host.Extensions /// static class TopicClientExtensions { + /// + /// Counter for topic request logging. + /// + static ulong topicRequestId; + /// /// Send a with optional repeated priority. /// @@ -45,13 +50,14 @@ namespace Tgstation.Server.Host.Extensions { firstSend = false; - logger.LogTrace("Begin topic request"); + var localRequestId = Interlocked.Increment(ref topicRequestId); + logger.LogTrace("Begin topic request #{requestId}: {query}", localRequestId, queryString); var byondResponse = await topicClient.SendTopic( endpoint, queryString, cancellationToken); - logger.LogTrace("End topic request"); + logger.LogTrace("End topic request #{requestId}", localRequestId); return byondResponse; } catch (Exception ex) when (ex is not OperationCanceledException)