-
Notifications
You must be signed in to change notification settings - Fork 483
Expand file tree
/
Copy pathGrpcWorkerChannel.Log.cs
More file actions
30 lines (25 loc) · 1.42 KB
/
GrpcWorkerChannel.Log.cs
File metadata and controls
30 lines (25 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using Microsoft.Extensions.Logging;
using static Microsoft.Azure.WebJobs.Script.Grpc.Messages.StreamingMessage;
namespace Microsoft.Azure.WebJobs.Script.Grpc
{
internal partial class GrpcWorkerChannel
{
// EventId range is 800-899
private static class Logger
{
private static readonly Action<ILogger, string, ContentOneofCase, Exception> _channelReceivedMessage = LoggerMessage.Define<string, ContentOneofCase>(
LogLevel.Debug,
new EventId(820, nameof(ChannelReceivedMessage)),
"[channel] received {workerId}: {msgType}");
private static readonly Action<ILogger, string, Exception> _invocationResponseReceived = LoggerMessage.Define<string>(
LogLevel.Debug,
new EventId(821, nameof(InvocationResponseReceived)),
"InvocationResponse received for invocation: '{invocationId}'");
internal static void ChannelReceivedMessage(ILogger logger, string workerId, ContentOneofCase msgType) => _channelReceivedMessage(logger, workerId, msgType, null);
internal static void InvocationResponseReceived(ILogger logger, string invocationId) => _invocationResponseReceived(logger, invocationId, null);
}
}
}