Skip to content

Commit ac885aa

Browse files
authored
Merge pull request #198 from Nakano37/iformatter
ZLOG0191: Use IFormattable instead of ISpanFormattable
2 parents 6252595 + 1a9343a commit ac885aa

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/ZLogger/ZLoggerInterpolatedStringHandler.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,18 +255,14 @@ public void ToString(IBufferWriter<byte> writer, MagicalBox box, Span<Interpolat
255255
}
256256
else if (p.BoxedValue is IEnumerable enumerable)
257257
{
258-
#if NET8_0
259-
if (p.BoxedValue is ISpanFormattable spanFormattable)
258+
if (p.BoxedValue is IFormattable)
260259
{
261260
stringWriter.AppendFormatted(p.BoxedValue, p.Alignment, p.Format);
262261
}
263262
else
264263
{
265264
CodeGeneratorUtil.AppendAsJson(ref stringWriter, p.BoxedValue, p.Type);
266265
}
267-
#else
268-
CodeGeneratorUtil.AppendAsJson(ref stringWriter, p.BoxedValue, p.Type);
269-
#endif
270266
}
271267
else
272268
{

0 commit comments

Comments
 (0)