Skip to content

Commit

Permalink
feat: improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
josephnhtam committed Sep 29, 2024
1 parent 015bf20 commit fa64ace
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public static void Publish(this ILogger logger, uint clientId, string streamName
[LoggerMessage(LogLevel.Warning, "ClientId: {ClientId} | Stream is not yet created")]
public static partial void StreamNotYetCreated(this ILogger logger, uint clientId);

[LoggerMessage(LogLevel.Warning, "ClientId: {ClientId} | StreamId: {StreamId} | Stream is not yet created")]
public static partial void PublishStreamNotYetCreated(this ILogger logger, uint clientId, uint streamId);

[LoggerMessage(LogLevel.Trace, "ClientId: {ClientId} | Acknowledgement received")]
public static partial void AcknowledgementReceived(this ILogger logger, uint clientId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public async ValueTask<bool> HandleAsync(

if (publishStreamContext == null)
{
_logger.StreamNotYetCreated(clientContext.Client.Id);
_logger.PublishStreamNotYetCreated(clientContext.Client.Id, streamId);
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public async ValueTask<bool> HandleAsync(

if (publishStreamContext == null)
{
_logger.StreamNotYetCreated(clientContext.Client.Id);
_logger.PublishStreamNotYetCreated(clientContext.Client.Id, streamId);
return false;
}

Expand Down

0 comments on commit fa64ace

Please sign in to comment.