From 80e595f61b055e640bd63326b46b9ea9dbe3bd84 Mon Sep 17 00:00:00 2001 From: Ruben Bartelink Date: Mon, 14 Oct 2024 09:22:58 +0100 Subject: [PATCH] feat(TimelineEvent.ToString): Render IsUnfold, EventType, Index (#123) --- CHANGELOG.md | 3 +++ src/FsCodec/FsCodec.fs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31e6021..1512316 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ The `Unreleased` section name is replaced by the expected version of next releas ## [Unreleased] ### Added + +- `TimelineEvent.ToString`: Render Unfold/Event state, EventType, Index [#123](https://github.com/jet/FsCodec/pull/123) + ### Changed ### Removed ### Fixed diff --git a/src/FsCodec/FsCodec.fs b/src/FsCodec/FsCodec.fs index 725beac..f811585 100755 --- a/src/FsCodec/FsCodec.fs +++ b/src/FsCodec/FsCodec.fs @@ -89,6 +89,8 @@ type TimelineEvent<'Format>(index, eventType, data, meta, eventId, correlationId let size = defaultArg size 0 TimelineEvent(index, inner.EventType, inner.Data, inner.Meta, inner.EventId, inner.CorrelationId, inner.CausationId, inner.Timestamp, isUnfold, Option.toObj context, size) :> _ + override _.ToString() = sprintf "%s %s @%i" (if isUnfold then "Unfold" else "Event") eventType index + interface ITimelineEvent<'Format> with member _.Index = index member _.IsUnfold = isUnfold