mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-22 04:27:19 +01:00
Improve TopicClientExtensions logging
This commit is contained in:
@@ -16,6 +16,11 @@ namespace Tgstation.Server.Host.Extensions
|
||||
/// </summary>
|
||||
static class TopicClientExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Counter for topic request logging.
|
||||
/// </summary>
|
||||
static ulong topicRequestId;
|
||||
|
||||
/// <summary>
|
||||
/// Send a <paramref name="queryString"/> with optional repeated priority.
|
||||
/// </summary>
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user