Skip to content

Commit 433ba41

Browse files
HirogenCopilot
andauthored
Update src/ColumnizerLib/ILogLine.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 97808ba commit 433ba41

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

src/ColumnizerLib/ILogLine.cs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,34 @@ public interface ILogLine : ITextValue
1111
#endregion
1212
}
1313

14+
/// <summary>
15+
/// Represents a single log line, including its full text and line number.
16+
/// </summary>
17+
/// <remarks>
18+
/// <para>
19+
/// <b>Purpose:</b> <br/>
20+
/// The <c>LogLine</c> struct encapsulates the content and line number of a log entry. It is used throughout the
21+
/// columnizer and log processing infrastructure to provide a strongly-typed, immutable representation of a log line.
22+
/// </para>
23+
/// <para>
24+
/// <b>Usage:</b> <br/>
25+
/// This struct implements the <see cref="ILogLine"/> interface, allowing it to be used wherever an <c>ILogLine</c>
26+
/// is expected. It provides value semantics and is intended to be lightweight and efficiently passed by value.
27+
/// </para>
28+
/// <para>
29+
/// <b>Relationship to ILogLine:</b> <br/>
30+
/// <c>LogLine</c> is a concrete, immutable implementation of the <see cref="ILogLine"/> interface, providing
31+
/// properties for the full line text and its line number.
32+
/// </para>
33+
/// <para>
34+
/// <b>Why struct instead of record:</b> <br/>
35+
/// A <c>struct</c> is preferred over a <c>record</c> here to avoid heap allocations and to provide value-type
36+
/// semantics, which are beneficial for performance when processing large numbers of log lines. The struct is
37+
/// immutable (readonly), ensuring thread safety and predictability. The previous <c>record</c> implementation
38+
/// was replaced to better align with these performance and semantic requirements.
39+
/// </para>
40+
/// </remarks>
1441
public readonly struct LogLine (string fullLine, int lineNumber) : ILogLine
15-
{
1642
public string FullLine { get; } = fullLine;
1743

1844
public int LineNumber { get; } = lineNumber;

0 commit comments

Comments
 (0)