Struct LogMessage
The struct for dispatching and processing log messages.
Implements
Inherited Members
Namespace: Unity.Logging
Assembly: Unity.Logging.dll
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, long, LogLevel).
Constructors
LogMessage(PayloadHandle, long, long, 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 |
long | timestamp | Timestamp of the message |
long | 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 |
---|---|
long |
Timestamp
Timestamp to sort messages
Declaration
public readonly long Timestamp
Field Value
Type | Description |
---|---|
long |
Methods
CompareTo(LogMessage)
Compares this LogMessage to another. Compares only timestamps. Needed for timestamp sorting
Declaration
public int CompareTo(LogMessage other)
Parameters
Type | Name | Description |
---|---|---|
LogMessage | other | Another LogMessage |
Returns
Type | Description |
---|---|
int | True if timestamps are the same |