Skip to content

Commit 212ad03

Browse files
committed
FEATURE_SPAN
1 parent ab5fdb8 commit 212ad03

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Serilog.Sinks.Console/Serilog.Sinks.Console.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
<DefineConstants>$(DefineConstants);RUNTIME_INFORMATION</DefineConstants>
2727
</PropertyGroup>
2828

29+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
30+
<DefineConstants>$(DefineConstants);FEATURE_SPAN</DefineConstants>
31+
</PropertyGroup>
32+
2933
<ItemGroup>
3034
<PackageReference Include="Serilog" Version="2.10.0" />
3135
<PackageReference Include="Nullable" Version="1.3.0" PrivateAssets="all" />

src/Serilog.Sinks.Console/Sinks/SystemConsole/Output/TimestampTokenRenderer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void Render(TextWriter output, string? format = null, IFormatProvider? fo
7474
return;
7575
}
7676

77-
#if NET5_0_OR_GREATER
77+
#if FEATURE_SPAN
7878
Span<char> buffer = stackalloc char[32];
7979
if (Value.TryFormat(buffer, out int written, format, formatProvider ?? CultureInfo.InvariantCulture))
8080
output.Write(buffer.Slice(0, written));

0 commit comments

Comments
 (0)