-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more logging to Azure QueueStorage EventBus
- Loading branch information
1 parent
a1450b3
commit 8bc353b
Showing
2 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
|
||
namespace Microsoft.Extensions.Logging | ||
{ | ||
/// <summary> | ||
/// Extensions on <see cref="ILogger"/> for the EventBus | ||
/// </summary> | ||
internal static class ILoggerExtensions | ||
{ | ||
private static readonly Action<ILogger, int, Exception> _startingBus | ||
= LoggerMessage.Define<int>( | ||
eventId: new EventId(1, nameof(StartingBus)), | ||
logLevel: LogLevel.Debug, | ||
formatString: "Starting bus receivers. Consumers: '{ConsumersCount}'"); | ||
|
||
private static readonly Action<ILogger, Exception> _stoppingBus | ||
= LoggerMessage.Define( | ||
eventId: new EventId(2, nameof(StoppingBus)), | ||
logLevel: LogLevel.Debug, | ||
formatString: "Stopping bus receivers."); | ||
|
||
public static void StartingBus(this ILogger logger, int consumersCount) => _startingBus(logger, consumersCount, null); | ||
|
||
public static void StoppingBus(this ILogger logger) => _stoppingBus(logger, null); | ||
} | ||
} |