Struct LogMessage
The struct for dispatching and processing log messages.
Inherited Members
Namespace: Unity.Logging
Syntax
public readonly struct LogMessage : IComparable<LogMessage>
Remarks
Log message data is allocated and stored using LogMemoryManager, which is referenced by this struct via a PayloadHandle. Log messages can be dispatched through DispatchMessage(PayloadHandle, Int64, LogLevel).
Constructors
LogMessage(PayloadHandle, Int64, Int64, LogLevel)
Create a new LogMessage
Declaration
public LogMessage(PayloadHandle payload, long timestamp, long stacktraceId, LogLevel level)
Parameters
Type | Name | Description |
---|---|---|
PayloadHandle | payload | PayloadHandle of the binary data |
Int64 | timestamp | Timestamp of the message |
Int64 | stacktraceId | Id of stacktrace connected to this message, or 0 |
LogLevel | level | LogLevel of this message |
Fields
Level
Log Level: Verbose, Debug, Info, Warning, Error, Fatal
Declaration
public readonly LogLevel Level
Field Value
Type | Description |
---|---|
LogLevel |
Payload
References the log message data allocated through LogMemoryManager.
Declaration
public readonly PayloadHandle Payload
Field Value
Type | Description |
---|---|
PayloadHandle |
StackTraceId
StackTraceId
Declaration
public readonly long StackTraceId
Field Value
Type | Description |
---|---|
Int64 |
Timestamp
Timestamp to sort messages
Declaration
public readonly long Timestamp
Field Value
Type | Description |
---|---|
Int64 |
Methods
CompareTo(LogMessage)
Compares this LogMessage to another. Compares only timestamps. Needed for timestamp sorting
Declaration
public readonly int CompareTo(LogMessage other)
Parameters
Type | Name | Description |
---|---|---|
LogMessage | other | Another LogMessage |
Returns
Type | Description |
---|---|
Int32 | True if timestamps are the same |