Struct
LogStreamEntry
Represents a single log entry with a timestamp, severity level, and message.
public readonly struct LogStreamEntry : IEquatable<LogStreamEntry>, IComparable<LogStreamEntry>, IFormattableImplements #
IEquatable<LogStreamEntry>, IComparable<LogStreamEntry>, IFormattable
Inherited Members #
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors #
| Name | Description |
|---|---|
| LogStreamEntry(string) | Initializes a new instance of the LogEntry class with the specified message and an information log level. |
| LogStreamEntry(LogEntryLevel, string) | Initializes a new instance of the LogStreamEntry struct with the specified level and message, setting the moment to the current time. |
| LogStreamEntry(DateTimeOffset, LogEntryLevel, string) | Initializes a new instance of the LogStreamEntry struct with the specified moment, level, and message. |
Properties #
| Name | Description |
|---|---|
| Level | Gets the severity level of the log entry. |
| Message | Gets the log message. |
| Moment | Gets the point in time when the log entry was created. |
Methods #
| Name | Description |
|---|---|
| CompareTo(LogStreamEntry) | Compares this log entry to another log entry based on their moment. |
| CreateDebug(string) | Creates a debug log entry with the specified message. |
| CreateError(string) | Creates an error log entry with the specified message. |
| CreateError(Exception) | Creates an error log entry from the specified exception. |
| CreateInformation(string) | Creates an informational log entry with the specified message. |
| CreateWarning(string) | Creates a warning log entry with the specified message. |
| CreateWarning(Exception) | Creates a warning log entry from the specified exception. |
| Equals(object?) | Determines whether this log entry is equal to the specified object. |
| Equals(LogStreamEntry) | Determines whether this log entry is equal to another log entry. |
| GetHashCode() | Returns the hash code for this log entry. |
| ToString() | Returns a string representation of the log entry in the default format. |
| ToString(string?, IFormatProvider?) | Returns a string representation of the log entry using the specified format string and format provider. |