| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using System.IO.Pipelines; |
| | | 6 | | using Microsoft.Extensions.Logging; |
| | | 7 | | |
| | | 8 | | namespace CoreWCF.Channels.Framing |
| | | 9 | | { |
| | | 10 | | internal static class FramingLoggingExtensions |
| | | 11 | | { |
| | 0 | 12 | | private static Action<ILogger, string, int, string, Exception> s_connectionLogging = LoggerMessage.Define<string |
| | 0 | 13 | | LogLevel.Trace, |
| | 0 | 14 | | new EventId(1059, "ConnectionLogging"), |
| | 0 | 15 | | "{method}[{byteCount}]{data}"); |
| | | 16 | | |
| | | 17 | | public static void LogBytes(this ILogger logger, string method, int count, string data) |
| | | 18 | | { |
| | 0 | 19 | | s_connectionLogging(logger, method, count, data, null); |
| | 0 | 20 | | } |
| | | 21 | | } |
| | | 22 | | } |