From 95fca809e831d1fdb50119f36881043a0c224144 Mon Sep 17 00:00:00 2001 From: Lowell Manners Date: Wed, 23 Dec 2020 11:38:10 +0100 Subject: [PATCH] Add AppendKeyValueAscii methods to ILogEvent interface --- src/ZeroLog/ForwardingLogEvent.cs | 4 ++++ src/ZeroLog/ILogEvent.cs | 4 ++++ src/ZeroLog/NoopLogEvent.cs | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/ZeroLog/ForwardingLogEvent.cs b/src/ZeroLog/ForwardingLogEvent.cs index 813ca092..1d64b7ff 100644 --- a/src/ZeroLog/ForwardingLogEvent.cs +++ b/src/ZeroLog/ForwardingLogEvent.cs @@ -40,6 +40,10 @@ public void AppendGeneric(T arg) public ILogEvent AppendAsciiString(ReadOnlySpan bytes) => this; public ILogEvent AppendAsciiString(ReadOnlySpan chars) => this; public ILogEvent AppendKeyValue(string key, string? value) => this; + public ILogEvent AppendKeyValueAscii(string key, byte[]? bytes, int length) => this; + public unsafe ILogEvent AppendKeyValueAscii(string key, byte* bytes, int length) => this; + public ILogEvent AppendKeyValueAscii(string key, ReadOnlySpan bytes) => this; + public ILogEvent AppendKeyValueAscii(string key, ReadOnlySpan chars) => this; public ILogEvent AppendKeyValue(string key, T value) where T : struct, Enum diff --git a/src/ZeroLog/ILogEvent.cs b/src/ZeroLog/ILogEvent.cs index d81543ec..0b85e968 100644 --- a/src/ZeroLog/ILogEvent.cs +++ b/src/ZeroLog/ILogEvent.cs @@ -12,6 +12,10 @@ public partial interface ILogEvent : ILogEventHeader unsafe ILogEvent AppendAsciiString(byte* bytes, int length); ILogEvent AppendAsciiString(ReadOnlySpan bytes); ILogEvent AppendAsciiString(ReadOnlySpan chars); + ILogEvent AppendKeyValueAscii(string key, byte[]? bytes, int length); + unsafe ILogEvent AppendKeyValueAscii(string key, byte* bytes, int length); + ILogEvent AppendKeyValueAscii(string key, ReadOnlySpan bytes); + ILogEvent AppendKeyValueAscii(string key, ReadOnlySpan chars); ILogEvent AppendEnum(T value) where T : struct, Enum; diff --git a/src/ZeroLog/NoopLogEvent.cs b/src/ZeroLog/NoopLogEvent.cs index 2318d856..963b9ead 100644 --- a/src/ZeroLog/NoopLogEvent.cs +++ b/src/ZeroLog/NoopLogEvent.cs @@ -37,6 +37,10 @@ public void AppendGeneric(T arg) public ILogEvent AppendAsciiString(ReadOnlySpan bytes) => this; public ILogEvent AppendAsciiString(ReadOnlySpan chars) => this; public ILogEvent AppendKeyValue(string key, string? value) => this; + public ILogEvent AppendKeyValueAscii(string key, byte[]? bytes, int length) => this; + public unsafe ILogEvent AppendKeyValueAscii(string key, byte* bytes, int length) => this; + public ILogEvent AppendKeyValueAscii(string key, ReadOnlySpan bytes) => this; + public ILogEvent AppendKeyValueAscii(string key, ReadOnlySpan chars) => this; public ILogEvent AppendKeyValue(string key, T value) where T : struct, Enum