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
TimestampDateTimeWhen the log entry was created
LevelLogLevelThe severity level of the log entry
MessagestringThe log message
CategorystringOptional category for grouping related logs
ExceptionExceptionOptional exception associated with this log entry
Properties
Category
Optional category for grouping related logs
public string? Category { get; init; }
Property Value
Exception
Optional exception associated with this log entry
public Exception? Exception { get; init; }
Property Value
Level
The severity level of the log entry
public LogLevel Level { get; init; }
Property Value
Message
The log message
public string Message { get; init; }
Property Value
Timestamp
When the log entry was created
public DateTime Timestamp { get; init; }
Property Value
Methods
ToMarkup()
Returns a markup-formatted string for display in Spectre.Console controls
public string ToMarkup()
Returns
ToString()
Returns a formatted string representation of this log entry
public override string ToString()