Table of Contents

Class LogEntry

Namespace
SharpConsoleUI.Logging
Assembly
SharpConsoleUI.dll

Represents a single log entry in the library's internal log buffer

public record LogEntry : IEquatable<LogEntry>
Inheritance
LogEntry
Implements
Inherited Members

Constructors

LogEntry(DateTime, LogLevel, string, string?, Exception?)

Represents a single log entry in the library's internal log buffer

public LogEntry(DateTime Timestamp, LogLevel Level, string Message, string? Category = null, Exception? Exception = null)

Parameters

Timestamp DateTime

When the log entry was created

Level LogLevel

The severity level of the log entry

Message string

The log message

Category string

Optional category for grouping related logs

Exception Exception

Optional exception associated with this log entry

Properties

Category

Optional category for grouping related logs

public string? Category { get; init; }

Property Value

string

Exception

Optional exception associated with this log entry

public Exception? Exception { get; init; }

Property Value

Exception

Level

The severity level of the log entry

public LogLevel Level { get; init; }

Property Value

LogLevel

Message

The log message

public string Message { get; init; }

Property Value

string

Timestamp

When the log entry was created

public DateTime Timestamp { get; init; }

Property Value

DateTime

Methods

ToMarkup()

Returns a markup-formatted string for display in Spectre.Console controls

public string ToMarkup()

Returns

string

ToString()

Returns a formatted string representation of this log entry

public override string ToString()

Returns

string