Skip to content

Commit 480b32c

Browse files
committed
trace2: use 'fmt' for the formatted message event field
In a message that is formatted/parameterised, we incorrectly use the field name of 'format' rather than 'fmt'. Fix this. Signed-off-by: Matthew John Cheetham <[email protected]>
1 parent d4e2f59 commit 480b32c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/shared/Core.Tests/Trace2MessageTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void Event_Message_Without_Snake_Case_ToJson_Creates_Expected_Json()
5454
ParameterizedMessage = "baz"
5555
};
5656

57-
var expected = "{\"event\":\"error\",\"sid\":\"123\",\"thread\":\"main\",\"time\":\"0001-01-01T00:00:00+00:00\",\"file\":\"foo.cs\",\"line\":1,\"depth\":1,\"msg\":\"bar\",\"format\":\"baz\"}";
57+
var expected = "{\"event\":\"error\",\"sid\":\"123\",\"thread\":\"main\",\"time\":\"0001-01-01T00:00:00+00:00\",\"file\":\"foo.cs\",\"line\":1,\"depth\":1,\"msg\":\"bar\",\"fmt\":\"baz\"}";
5858
var actual = errorMessage.ToJson();
5959

6060
Assert.Equal(expected, actual);

src/shared/Core/Trace2Message.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ public class ErrorMessage : Trace2Message
409409
[JsonPropertyOrder(8)]
410410
public string Message { get; set; }
411411

412-
[JsonPropertyName("format")]
412+
[JsonPropertyName("fmt")]
413413
[JsonPropertyOrder(9)]
414414
public string ParameterizedMessage { get; set; }
415415

0 commit comments

Comments
 (0)